/* Authentication Page Styles with Green Color Scheme - FINAL FIX */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #28a745 0%, #20c997 25%, #17a2b8 50%, #198754 75%, #155724 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: float 8s ease-in-out infinite;
    backdrop-filter: blur(2px);
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    background: linear-gradient(45deg, rgba(40, 167, 69, 0.3), rgba(255, 255, 255, 0.1));
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 25%;
    right: 15%;
    animation-delay: 1.5s;
    background: linear-gradient(45deg, rgba(32, 201, 151, 0.3), rgba(255, 255, 255, 0.1));
}

.shape-3 {
    width: 80px;
    height: 80px;
    bottom: 35%;
    left: 25%;
    animation-delay: 3s;
    background: linear-gradient(45deg, rgba(23, 162, 184, 0.3), rgba(255, 255, 255, 0.1));
}

.shape-4 {
    width: 120px;
    height: 120px;
    bottom: 15%;
    right: 25%;
    animation-delay: 4.5s;
    background: linear-gradient(45deg, rgba(25, 135, 84, 0.3), rgba(255, 255, 255, 0.1));
}

.shape-5 {
    width: 180px;
    height: 180px;
    top: 45%;
    left: 45%;
    animation-delay: 6s;
    background: linear-gradient(45deg, rgba(21, 87, 36, 0.3), rgba(255, 255, 255, 0.1));
}

.shape-6 {
    width: 60px;
    height: 60px;
    top: 70%;
    left: 70%;
    animation-delay: 2s;
    background: linear-gradient(45deg, rgba(40, 167, 69, 0.4), rgba(255, 255, 255, 0.15));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }
    33% {
        transform: translateY(-30px) rotate(120deg) scale(1.1);
    }
    66% {
        transform: translateY(15px) rotate(240deg) scale(0.9);
    }
}

.auth-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 1rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 3rem 2.5rem;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: slideInUp 1s ease-out;
    border: 1px solid rgba(40, 167, 69, 0.2);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #20c997, #17a2b8, #198754);
    border-radius: 25px 25px 0 0;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: #198754;
    animation: logoGlow 3s ease-in-out infinite alternate;
}

.auth-logo i {
    font-size: 2.5rem;
    margin-right: 0.5rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: iconRotate 4s ease-in-out infinite;
}

@keyframes logoGlow {
    0% { text-shadow: 0 0 5px rgba(40, 167, 69, 0.3); }
    100% { text-shadow: 0 0 20px rgba(40, 167, 69, 0.6), 0 0 30px rgba(32, 201, 151, 0.4); }
}

@keyframes iconRotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.05); }
}

.auth-header h2 {
    color: #155724;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-family: 'Montserrat', sans-serif;
    position: relative;
}

.auth-header h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 2px;
}

.auth-header p {
    color: #198754;
    font-size: 1rem;
    margin-bottom: 0;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #155724;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #d4edda;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.9);
    font-family: 'Roboto', sans-serif;
    position: relative;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 
        0 0 0 4px rgba(40, 167, 69, 0.15),
        0 8px 25px rgba(40, 167, 69, 0.1);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
}

.form-control:focus + label {
    color: #28a745;
    transform: scale(1.05);
}

.form-control.is-invalid {
    border-color: #dc3545;
    animation: shake 0.6s ease-in-out;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
}

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

.input-group {
    position: relative;
    display: block;
    width: 100%;
}

.input-group .form-control {
    padding-right: 3.5rem !important;
    width: 100% !important;
    display: block !important;
    border-radius: 12px !important;
    border: 2px solid #d4edda !important;
}

.input-group .toggle-password {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    color: #28a745 !important;
    cursor: pointer !important;
    font-size: 1.1rem !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
    padding: 8px !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.input-group .toggle-password:hover {
    color: #20c997 !important;
    background: rgba(40, 167, 69, 0.1) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.input-group .toggle-password:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2) !important;
}

.btn-auth-primary {
    width: 100%;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 25%, #17a2b8 75%, #198754 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn-auth-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;
}

.btn-auth-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(40, 167, 69, 0.4);
    color: white;
}

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

.btn-auth-primary:active {
    transform: translateY(-1px);
}

.btn-auth-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-auth-primary .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

.btn-auth-primary.loading .spinner {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: #28a745;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.auth-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

.auth-links a:hover {
    color: #20c997;
    transform: translateY(-1px);
}

.auth-links a:hover::after {
    width: 100%;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #28a745, transparent);
}

.divider span {
    background: rgba(255, 255, 255, 0.98);
    padding: 0 1rem;
    color: #198754;
    font-size: 0.9rem;
    font-weight: 500;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
}

.error-message.show {
    display: block;
    animation: fadeInDown 0.4s ease;
}

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

.success-message {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
}

.success-message.show {
    display: block;
    animation: fadeInDown 0.4s ease;
}

.row-cols {
    display: flex;
    gap: 1rem;
}

.row-cols .form-group {
    flex: 1;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    margin: 0;
    accent-color: #28a745;
}

.form-check-label {
    margin: 0;
    font-size: 0.9rem;
    color: #198754;
    font-weight: 500;
}

.form-check-label a {
    color: #28a745;
    text-decoration: none;
    font-weight: 600;
}

.form-check-label a:hover {
    text-decoration: underline;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-options a {
    color: #28a745;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-options a:hover {
    color: #20c997;
    text-decoration: underline;
}

/* Country select styling */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2328a745' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .auth-page {
        padding: 1rem 0;
        min-height: calc(100vh - 140px);
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }
    
    .auth-logo {
        font-size: 1.5rem;
    }
    
    .auth-logo i {
        font-size: 2rem;
    }
    
    .auth-header h2 {
        font-size: 1.75rem;
    }
    
    .row-cols {
        flex-direction: column;
        gap: 0;
    }
    
    .input-group .toggle-password {
        right: 8px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .auth-logo {
        font-size: 1.3rem;
    }
    
    .input-group .toggle-password {
        right: 6px !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 0.9rem !important;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(40, 167, 69, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* OTP Page Specific Styles */
.otp-container .auth-card {
    max-width: 450px;
}

.otp-inputs {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-bottom: 1.5rem !important;
    flex-direction: row !important;
}

.otp-input {
    width: 50px;
    height: 60px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #d4edda;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #155724;
}

.otp-input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
    transform: scale(1.05);
}

.otp-input.filled {
    border-color: #28a745;
    background-color: #e9f7ef;
}

.countdown-timer {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: #198754;
}

.countdown-timer.expired {
    color: #dc3545;
    font-weight: 600;
}

.resend-section {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.resend-section p {
    margin-bottom: 0.5rem;
    color: #198754;
}

.btn-resend {
    background: none;
    border: 2px solid #28a745;
    color: #28a745;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-resend:hover {
    background: #28a745;
    color: white;
    transform: translateY(-2px);
}

.btn-resend:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
