/* ========================================
   AUTH PAGES SHARED STYLES
   Login, Register, Forgot Password, etc.
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.auth-page {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

body.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ========== CONTAINER ========== */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.8s ease-out;
    width: 100%;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== LEFT SIDE (CONTENT) ========== */
.auth-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 550px;
}

.auth-content::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.auth-content::after {
    content: '';
    position: absolute;
    width: 250px;
    height: 250px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    bottom: -80px;
    left: -50px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
}

.auth-content-inner {
    position: relative;
    z-index: 1;
    max-width: 350px;
}

.auth-icon-container {
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out 0.3s both;
}

.auth-icon-circle {
    width: 130px;
    height: 130px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.auth-icon-circle i {
    font-size: 60px;
    color: white;
}

.auth-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
    animation: fadeInDown 0.8s ease-out 0.4s both;
    letter-spacing: -1px;
}

.auth-subtitle {
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.8;
    margin-bottom: 35px;
    animation: fadeInDown 0.8s ease-out 0.5s both;
}

.auth-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    animation: fadeInDown 0.8s ease-out 0.6s both;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255,255,255,0.1);
    padding: 12px 16px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.feature-item i {
    font-size: 18px;
    color: #ffd700;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RIGHT SIDE (FORM) ========== */
.auth-form-section {
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 550px;
}

.auth-form-section.scrollable {
    overflow-y: auto;
}

.form-header {
    margin-bottom: 35px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.form-header-logo {
    margin-bottom: 25px;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.form-header-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.form-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.form-header p {
    color: #666;
    font-size: 14px;
}

/* ========== FORM ELEMENTS ========== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out calc(0.3s + var(--delay, 0s)) both;
}

.form-row.full {
    grid-template-columns: 1fr;
}

.form-row:nth-child(1) { --delay: 0s; }
.form-row:nth-child(2) { --delay: 0.1s; }
.form-row:nth-child(3) { --delay: 0.15s; }
.form-row:nth-child(4) { --delay: 0.2s; }
.form-row:nth-child(5) { --delay: 0.25s; }
.form-row:nth-child(6) { --delay: 0.3s; }

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

/* Input Validation States */
.form-group input.valid {
    border-color: #16a34a !important;
}

.form-group input.invalid {
    border-color: #dc2626 !important;
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #667eea;
}

/* Mobile Input Group */
.mobile-input-group {
    display: flex;
    gap: 0;
}

.country-code {
    padding: 14px 12px;
    background: #e9ecef;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 10px 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.mobile-input-group input {
    border-radius: 0 10px 10px 0;
}

/* ========== LOGIN TYPE TOGGLE ========== */
.login-type-toggle {
    display: flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out 0.25s both;
}

.login-type-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.login-type-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-type-btn:hover:not(.active) {
    color: #667eea;
}

.login-type-btn i {
    margin-right: 6px;
}

/* ========== GENDER SELECTOR ========== */
.gender-selector {
    display: flex;
    gap: 10px;
}

.gender-option {
    flex: 1;
}

.gender-option input {
    display: none;
}

.gender-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.gender-option label i {
    font-size: 16px;
}

.gender-option input:checked + label {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    color: #667eea;
}

.gender-option label:hover {
    border-color: #667eea;
}

/* ========== VALIDATION MESSAGES ========== */
.validation-msg {
    font-size: 12px;
    margin-top: 6px;
    display: none;
    align-items: center;
    gap: 6px;
}

.validation-msg.error {
    color: #dc2626;
    display: flex;
}

.validation-msg.success {
    color: #16a34a;
    display: flex;
}

.validation-msg i {
    font-size: 12px;
}

/* ========== PASSWORD STRENGTH ========== */
.password-strength {
    margin-top: 8px;
    display: none;
}

.password-strength.show {
    display: block;
}

.strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    width: 33%;
    background: #ef4444;
}

.strength-fill.medium {
    width: 66%;
    background: #f59e0b;
}

.strength-fill.strong {
    width: 100%;
    background: #22c55e;
}

.strength-text {
    font-size: 11px;
    font-weight: 600;
}

.strength-text.weak { color: #ef4444; }
.strength-text.medium { color: #f59e0b; }
.strength-text.strong { color: #22c55e; }

/* ========== CAPS LOCK WARNING ========== */
.caps-warning {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(245,158,11,0.1) 0%, rgba(217,119,6,0.1) 100%);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #b45309;
    font-weight: 500;
}

.caps-warning.show {
    display: flex;
}

.caps-warning i {
    font-size: 14px;
}

/* ========== FORM OPTIONS ========== */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    font-size: 14px;
    animation: fadeInUp 0.8s ease-out 0.35s both;
}

.form-options.checkbox-only {
    justify-content: flex-start;
    gap: 8px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.remember-me input[type="checkbox"],
.form-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-options label {
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    text-transform: none;
    letter-spacing: normal;
}

.forgot-password {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #764ba2;
}

/* ========== BUTTONS ========== */
.btn-auth {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-auth:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none !important;
}

.btn-auth .btn-text {
    transition: opacity 0.2s;
}

.btn-auth.loading .btn-text {
    opacity: 0;
}

.btn-auth .btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.btn-auth.loading .btn-loader {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== DIVIDER ========== */
.divider {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
    color: #999;
    animation: fadeInUp 0.8s ease-out 0.45s both;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.divider::before {
    margin-right: 12px;
}

.divider::after {
    margin-left: 12px;
}

/* ========== SOCIAL BUTTONS ========== */
.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.btn-social {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
}

.btn-social:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8f9ff;
}

.btn-social i {
    font-size: 16px;
}

/* ========== FORM FOOTER ========== */
.form-footer {
    text-align: center;
    font-size: 13px;
    color: #666;
    animation: fadeInUp 0.8s ease-out 0.55s both;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: #764ba2;
}

/* ========== FLASH MESSAGES ========== */
.flash-messages {
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease-out;
    width: 100%;
}

.flash-message {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
}

.flash-message i {
    font-size: 18px;
}

.flash-message.error,
.flash-message.danger {
    background: linear-gradient(135deg, rgba(239,68,68,0.1) 0%, rgba(220,38,38,0.1) 100%);
    color: #dc2626;
    border: 1px solid rgba(220,38,38,0.2);
}

.flash-message.success {
    background: linear-gradient(135deg, rgba(34,197,94,0.1) 0%, rgba(22,163,74,0.1) 100%);
    color: #16a34a;
    border: 1px solid rgba(22,163,74,0.2);
}

.flash-message.warning {
    background: linear-gradient(135deg, rgba(245,158,11,0.1) 0%, rgba(217,119,6,0.1) 100%);
    color: #d97706;
    border: 1px solid rgba(217,119,6,0.2);
}

.flash-message.info {
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(37,99,235,0.1) 100%);
    color: #2563eb;
    border: 1px solid rgba(37,99,235,0.2);
}

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    color: inherit;
}

.flash-close:hover {
    opacity: 1;
}

/* ========== TOAST NOTIFICATIONS ========== */
.flash-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash-toast {
    min-width: 280px;
    max-width: 340px;
    padding: 8px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    animation: flashSlideIn 0.3s ease-out forwards;
    backdrop-filter: blur(8px);
}

.flash-toast.error,
.flash-toast.danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    color: #991b1b;
}

.flash-toast.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    color: #166534;
}

.flash-toast.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    color: #92400e;
}

.flash-toast i {
    font-size: 16px;
    flex-shrink: 0;
}

.flash-toast-content {
    flex: 1;
}

.flash-toast-title {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 1px;
}

.flash-toast-msg {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.3;
}

.flash-toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.flash-toast-close:hover {
    opacity: 1;
}

@keyframes flashSlideIn {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes flashSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.flash-toast.removing {
    animation: flashSlideOut 0.3s ease-out forwards;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1024px) {
    .auth-wrapper {
        grid-template-columns: 1fr 1fr;
    }

    .auth-content {
        padding: 45px 35px;
        min-height: 500px;
    }

    .auth-form-section {
        padding: 45px 35px;
        min-height: 500px;
    }

    .auth-title {
        font-size: 32px;
    }

    .form-header h1 {
        font-size: 24px;
    }

    .form-header-logo img {
        height: 45px;
    }
}

@media (max-width: 768px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .auth-container {
        min-height: auto;
        padding: 15px;
    }

    .auth-content {
        padding: 40px 30px;
        min-height: auto;
    }

    .auth-form-section {
        padding: 40px 30px;
        min-height: auto;
        overflow-y: visible;
    }

    .auth-title {
        font-size: 28px;
        margin-bottom: 12px;
    }

    .auth-subtitle {
        font-size: 13px;
        margin-bottom: 28px;
    }

    .auth-icon-circle {
        width: 110px;
        height: 110px;
    }

    .auth-icon-circle i {
        font-size: 50px;
    }

    .form-header h1 {
        font-size: 22px;
    }

    .form-header-logo img {
        height: 40px;
    }

    .auth-features {
        gap: 10px;
    }

    .feature-item {
        font-size: 13px;
        padding: 10px 14px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 20px;
    }

    .form-row .form-group {
        margin-bottom: 15px;
    }

    .form-row .form-group:last-child {
        margin-bottom: 0;
    }

    .gender-selector {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .auth-wrapper {
        border-radius: 10px;
    }

    .auth-container {
        padding: 10px;
    }

    .auth-content {
        padding: 25px 20px;
        min-height: auto;
    }

    .auth-form-section {
        padding: 25px 20px;
        min-height: auto;
    }

    .auth-icon-container {
        margin-bottom: 18px;
    }

    .auth-icon-circle {
        width: 95px;
        height: 95px;
    }

    .auth-icon-circle i {
        font-size: 42px;
    }

    .auth-title {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .auth-subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .form-header {
        margin-bottom: 25px;
    }

    .form-header h1 {
        font-size: 19px;
    }

    .form-header p {
        font-size: 12px;
    }

    .form-header-logo img {
        height: 38px;
    }

    .form-group label {
        font-size: 11px;
    }

    .form-group input,
    .form-group select {
        padding: 11px 13px;
        font-size: 13px;
    }

    .form-options {
        margin-bottom: 22px;
        font-size: 12px;
    }

    .btn-auth {
        padding: 12px;
        font-size: 14px;
        margin-bottom: 18px;
    }

    .divider {
        font-size: 12px;
        margin-bottom: 18px;
    }

    .social-buttons {
        gap: 10px;
        margin-bottom: 18px;
    }

    .btn-social {
        padding: 10px;
        font-size: 12px;
    }

    .form-footer {
        font-size: 12px;
    }

    .gender-selector {
        flex-direction: column;
        gap: 8px;
    }

    .gender-option label {
        padding: 10px 12px;
    }
}
