/* Mobile-First Login Styles */

body.auth-body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e1e8ef 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ========== Mobile-First: Base styles target phones ========== */

.login-container {
    background: #fff;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-header {
    background: #ffffff;
    border-bottom: 1px solid #e1e8ef;
    padding: 32px 24px 24px;
    text-align: center;
}

.logo {
    margin-bottom: 16px;
}

.logo img {
    max-width: 200px;
    height: auto;
}

.login-subtitle {
    color: #059669;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-app-name {
    margin-top: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.login-body {
    padding: 32px 24px;
    flex: 1;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    text-align: center;
}

.login-description {
    color: #64748b;
    font-size: 14px;
    text-align: center;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 46px;
    border: 2px solid #e1e8ef;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
    color: #1e293b;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-input::placeholder {
    color: #cbd5e0;
}

.btn {
    width: 100%;
    padding: 16px;
    background: #059669;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    -webkit-appearance: none;
    appearance: none;
}

.btn:hover {
    background: #047857;
}

.btn:active {
    background: #065f46;
    transform: scale(0.98);
}

.btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

.help-text {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin-top: 24px;
}

.help-text a {
    color: #059669;
    text-decoration: none;
    font-weight: 600;
}

.help-text a:hover {
    text-decoration: underline;
}

.version-text {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 16px;
    font-weight: 400;
}

/* Messages */
.success-message {
    background: #d1fae5;
    border: 1px solid #059669;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 8px;
}

.success-message.show {
    display: flex;
}

.error-message {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 8px;
}

.error-message.show {
    display: flex;
}

/* Step Visibility */
.otp-step {
    display: none;
}

.otp-step.active {
    display: block;
}

.email-step.hidden {
    display: none;
}

/* Back Button */
.back-button {
    color: #059669;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-weight: 600;
    min-height: 44px;
}

.back-button:hover {
    text-decoration: underline;
}

/* Resend */
.resend-timer {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin-top: 16px;
}

.resend-link {
    color: #059669;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.resend-link:hover {
    text-decoration: underline;
}

.resend-link.disabled {
    color: #cbd5e0;
    cursor: not-allowed;
    text-decoration: none;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 32px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #1e293b;
    min-height: 44px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid #e1e8ef;
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: #059669;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #059669;
    border-color: #059669;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-weight: 500;
    color: #1e293b;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 41, 59, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(5, 150, 105, 0.2);
    border-top-color: #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* ========== Scale Up: Larger screens ========== */

@media (min-width: 480px) {
    body.auth-body {
        padding: 20px;
    }

    .login-container {
        max-width: 440px;
        min-height: auto;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }

    .login-header {
        padding: 40px 40px 30px;
    }

    .logo {
        margin-bottom: 20px;
    }

    .logo img {
        max-width: 220px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .login-body {
        padding: 40px;
    }

    .login-title {
        font-size: 24px;
    }

    .form-input {
        padding: 14px 16px 14px 46px;
    }

    .btn {
        padding: 14px;
        min-height: 48px;
    }

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    }

    .btn:active {
        transform: translateY(0);
    }
}
