/* =============================================
   Mushop Pro Validation - Enhanced Styles
   ============================================= */

/* CSS Custom Properties (Design Tokens) */
:root {
    --mpv-primary: #B9C674;
    --mpv-primary-dark: #9aa85c;
    --mpv-primary-light: #d4dc9a;
    --mpv-secondary: #2d3436;
    --mpv-accent: #DE680F;
    --mpv-accent-dark: #b8550a;
    --mpv-success: #28a745;
    --mpv-error: #dc3545;
    --mpv-white: #ffffff;
    --mpv-gray-100: #f8f9fa;
    --mpv-gray-200: #e9ecef;
    --mpv-gray-300: #dee2e6;
    --mpv-gray-500: #adb5bd;
    --mpv-gray-700: #495057;
    --mpv-gray-900: #212529;

    --mpv-radius-sm: 6px;
    --mpv-radius-md: 10px;
    --mpv-radius-lg: 16px;
    --mpv-radius-pill: 50px;

    --mpv-shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --mpv-shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --mpv-shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
    --mpv-shadow-glow: 0 0 20px rgba(185, 198, 116, 0.4);

    --mpv-transition-fast: 0.15s ease;
    --mpv-transition-base: 0.3s ease;
    --mpv-transition-slow: 0.5s ease;

    --mpv-font-size-sm: 0.875rem;
    --mpv-font-size-base: 1rem;
    --mpv-font-size-lg: 1.125rem;
}

/* =============================================
   Container & Layout
   ============================================= */

.mushop-auth-container {
    max-width: 520px;
    margin: 0 auto 100px;
    padding: 20px;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.mushop-logo {
    margin-bottom: 30px;
    animation: fadeInDown 0.5s ease-out;
}

.mushop-logo img {
    max-height: 80px;
    transition: transform var(--mpv-transition-base);
}

.mushop-logo:hover img {
    transform: scale(1.05);
}

/* =============================================
   Glassmorphism Card
   ============================================= */

.mushop-form-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 40px;
    border-radius: var(--mpv-radius-lg);
    box-shadow:
        var(--mpv-shadow-lg),
        inset 0 1px 0 rgba(255,255,255,0.8);
    text-align: left;
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.mushop-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mpv-primary), var(--mpv-accent), var(--mpv-primary));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

.mushop-form-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--mpv-secondary);
    text-align: center;
    font-weight: 600;
    font-size: 1.5rem;
    animation: fadeIn 0.4s ease-out 0.2s both;
}

/* =============================================
   Tab Navigation
   ============================================= */

.mushop-tabs {
    display: inline-flex;
    margin-bottom: 25px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    border-radius: var(--mpv-radius-pill);
    overflow: visible;
    position: relative;
    padding: 4px;
    box-shadow: var(--mpv-shadow-sm);
}

.mushop-tab {
    padding: 12px 28px;
    background: transparent;
    color: var(--mpv-gray-700);
    border: none;
    cursor: pointer;
    font-size: var(--mpv-font-size-base);
    font-weight: 500;
    border-radius: var(--mpv-radius-pill);
    transition: all var(--mpv-transition-base);
    position: relative;
    z-index: 1;
}

.mushop-tab.active {
    background: var(--mpv-primary);
    color: var(--mpv-white);
    box-shadow: var(--mpv-shadow-md);
}

.mushop-tab:not(.active):hover {
    background: var(--mpv-primary-light);
    color: var(--mpv-secondary);
}

/* =============================================
   Form Groups with Floating Labels
   ============================================= */

.form-group {
    margin-bottom: 20px;
    animation: fadeInUp 0.4s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }
.form-group:nth-child(6) { animation-delay: 0.35s; }
.form-group:nth-child(7) { animation-delay: 0.4s; }
.form-group:nth-child(8) { animation-delay: 0.45s; }
.form-group:nth-child(9) { animation-delay: 0.5s; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--mpv-gray-700);
    font-size: var(--mpv-font-size-sm);
    letter-spacing: 0.02em;
}

.required {
    color: var(--mpv-error);
    margin-left: 2px;
}

/* Input wrapper for animations */
.input-wrapper {
    position: relative;
}

/* Modern Input Styling */
.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--mpv-gray-200);
    border-radius: var(--mpv-radius-md);
    box-sizing: border-box;
    font-size: var(--mpv-font-size-base);
    background: var(--mpv-white);
    transition: all var(--mpv-transition-base);
    outline: none;
}

.form-control:hover {
    border-color: var(--mpv-gray-300);
}

.form-control:focus {
    border-color: var(--mpv-primary);
    box-shadow: 0 0 0 4px rgba(185, 198, 116, 0.15);
    background: var(--mpv-white);
}

.form-control::placeholder {
    color: var(--mpv-gray-500);
    opacity: 0.7;
    transition: opacity var(--mpv-transition-fast);
}

.form-control:focus::placeholder {
    opacity: 0.5;
}

/* Input with icon */
.icon-true {
    position: relative;
}

.icon-true .form-control {
    padding-left: 44px;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--mpv-gray-500);
    transition: color var(--mpv-transition-fast);
    pointer-events: none;
}

.form-control:focus ~ .input-icon,
.icon-true:focus-within .input-icon {
    color: var(--mpv-primary);
}

/* Focus border animation */
.focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--mpv-primary), var(--mpv-primary-dark));
    transition: all var(--mpv-transition-base);
    transform: translateX(-50%);
    border-radius: 2px;
}

.form-control:focus ~ .focus-border {
    width: calc(100% - 4px);
}

/* =============================================
   Password Field with Toggle
   ============================================= */

.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--mpv-gray-500);
    transition: color var(--mpv-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--mpv-primary);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* =============================================
   Buttons
   ============================================= */

.btn {
    padding: 14px 32px;
    cursor: pointer;
    font-size: var(--mpv-font-size-base);
    font-weight: 600;
    border-radius: var(--mpv-radius-md);
    border: none;
    transition: all var(--mpv-transition-base);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.module-mushopprovalidation-proauth .btn-primary {
    background: linear-gradient(135deg, var(--mpv-accent), var(--mpv-accent-dark));
    color: var(--mpv-white);
    box-shadow: 0 4px 15px rgba(222, 104, 15, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.module-mushopprovalidation-proauth .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(222, 104, 15, 0.4);
    color: var(--mpv-white);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Loading spinner */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--mpv-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn.loading .btn-spinner {
    display: block;
}

.btn.loading .btn-text {
    opacity: 0.7;
}

/* Ripple effect */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* =============================================
   Form Footer
   ============================================= */

.form-footer {
    margin-top: 30px;
    text-align: center;
    animation: fadeIn 0.4s ease-out 0.3s both;
}

.form-footer a {
    display: block;
    margin-top: 20px;
    color: var(--mpv-accent);
    text-decoration: none;
    font-size: var(--mpv-font-size-sm);
    transition: color var(--mpv-transition-fast);
}

.form-footer a:hover {
    color: var(--mpv-accent-dark);
    text-decoration: underline;
}

/* =============================================
   Alerts
   ============================================= */

.alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: var(--mpv-radius-md);
    animation: alertSlide 0.4s ease-out;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.alert-danger {
    background: linear-gradient(135deg, #fff5f5, #fed7d7);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-danger ul {
    margin: 0;
    padding-left: 20px;
}

.alert-danger li {
    margin-bottom: 6px;
}

.alert-success {
    background: linear-gradient(135deg, #f0fff4, #c6f6d5);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-success p {
    margin: 6px 0;
}

/* =============================================
   Validation States
   ============================================= */

.form-control.is-valid {
    border-color: var(--mpv-success);
}

.form-control.is-invalid {
    border-color: var(--mpv-error);
    animation: shake 0.4s ease;
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

/* Success checkmark */
.input-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--mpv-success);
    opacity: 0;
    transition: opacity var(--mpv-transition-fast);
}

.form-control.is-valid ~ .input-check {
    opacity: 1;
}

/* =============================================
   Success State
   ============================================= */

.success-checkmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: successPop 0.5s ease-out;
}

.success-checkmark svg {
    width: 80px;
    height: 80px;
    color: var(--mpv-success);
    margin-bottom: 20px;
}

.success-checkmark h3 {
    color: var(--mpv-secondary);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.success-checkmark p {
    color: var(--mpv-gray-700);
    text-align: center;
}

/* =============================================
   Responsive Styles
   ============================================= */

.row {
    display: flex;
    gap: 16px;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.col-md-6 {
    flex: 1;
}

.col-md-8 {
    flex: 0 0 66.667%;
    max-width: 66.667%;
}

@media (max-width: 768px) {
    .mushop-auth-container {
        max-width: 100%;
        padding: 16px;
        margin-bottom: 60px;
    }

    .mushop-form-container {
        padding: 24px;
    }

    .row {
        flex-direction: column;
        gap: 0;
    }

    .col-md-4,
    .col-md-8 {
        flex: 1;
        max-width: 100%;
    }

    .mushop-tabs {
        flex-direction: column;
        width: 100%;
        border-radius: var(--mpv-radius-md);
    }

    .mushop-tab {
        border-radius: var(--mpv-radius-md);
    }

    .btn {
        width: 100%;
    }

    .form-control-label {
        padding-top: 0;
    }
}

/* =============================================
   Animations
   ============================================= */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Tab content transition */
.mushop-form-container.tab-enter {
    animation: tabEnter 0.4s ease-out;
}

@keyframes tabEnter {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =============================================
   Page Background
   ============================================= */

.module-mushopprovalidation-proauth main {
    background: url('/modules/mushopprovalidation/views/img/bg.jpg') no-repeat center center;
    min-height: 100vh;
    background-size: cover;
    display: flex;
    align-items: center;
}

/* =============================================
   Additional Utility Classes
   ============================================= */

.text-muted {
    color: var(--mpv-gray-500);
    font-size: var(--mpv-font-size-sm);
}

.form-text {
    margin-top: 6px;
    display: block;
}

/* Disable default input icon for password managers */
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    right: 0;
}