/**
 * Auth Styles - shared styles for login and change-password pages
 * Used by: login.html, change_password.html
 */

/* ══════════════════════════════════════════
   LOGIN PAGE - Split Layout
══════════════════════════════════════════ */

.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left Side - Form */
.login-form-side {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 60px;
    position: relative;
}

.login-form-wrapper {
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
}

.login-form-wrapper h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 40px;
}

/* Form Inputs */
.auth-form-group {
    margin-bottom: 16px;
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #a0aec0;
    pointer-events: none;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.auth-form-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    background: #f8fafc;
    transition: all 0.2s;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--main-dark-royal, #034078);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--auth-focus-ring, rgba(18, 130, 162, 0.15));
}

.auth-form-group input::placeholder {
    color: #a0aec0;
}

.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #a0aec0;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #718096;
}

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

/* Forgot Password Link */
.forgot-password-row {
    text-align: right;
    margin-bottom: 20px;
}

.forgot-password-row a {
    color: var(--accent-teal, #1282A2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-password-row a:hover {
    text-decoration: underline;
}

/* Auth Buttons */
.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn-primary {
    background: var(--main-dark-royal, #034078);
    color: white;
}

.auth-btn-primary:hover {
    background: var(--accent-navy, #001F54);
}

.auth-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-btn-secondary {
    background: #ffffff;
    color: #1a202c;
    border: 1px solid #e2e8f0;
    margin-top: 12px;
}

.auth-btn-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* GHL Login Button */
.auth-btn-ghl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1a73e8;
    color: white;
    text-decoration: none;
    margin-top: 0;
}

.auth-btn-ghl:hover {
    background: #1557b0;
}

.auth-btn-ghl svg {
    flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: #a0aec0;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Sign Up Link */
.signup-row {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #718096;
}

.signup-row a {
    color: var(--accent-teal, #1282A2);
    text-decoration: none;
    font-weight: 500;
}

.signup-row a:hover {
    text-decoration: underline;
}

/* Auth Messages */
.auth-error-message {
    background: #fef2f2;
    color: var(--danger, #EF4444);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    border: 1px solid #fecaca;
}

.auth-error-message.show {
    display: block;
}

.auth-success-message {
    background: #f0fdf4;
    color: var(--success, #10B981);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    border: 1px solid #bbf7d0;
}

.auth-success-message.show {
    display: block;
}

/* Footer */
.login-footer {
    position: absolute;
    bottom: 20px;
    left: 60px;
    right: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #718096;
}

.login-footer a {
    color: #718096;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-footer a:hover {
    color: #4a5568;
}

.login-footer svg {
    width: 16px;
    height: 16px;
}

/* ══════════════════════════════════════════
   RIGHT SIDE - Branding
══════════════════════════════════════════ */

.branding-side {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0b1929;
}

.branding-side .branding-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.branding-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 800'%3E%3Ccircle cx='400' cy='400' r='300' fill='none' stroke='%23ffffff' stroke-width='2'/%3E%3Ccircle cx='400' cy='400' r='250' fill='none' stroke='%23ffffff' stroke-width='1.5'/%3E%3Ccircle cx='400' cy='400' r='200' fill='none' stroke='%23ffffff' stroke-width='1'/%3E%3Ccircle cx='400' cy='400' r='150' fill='none' stroke='%23ffffff' stroke-width='1'/%3E%3Cpath d='M400 80 L410 100 L390 100 Z' fill='%23ffffff'/%3E%3Cpath d='M400 720 L410 700 L390 700 Z' fill='%23ffffff'/%3E%3Cpath d='M80 400 L100 410 L100 390 Z' fill='%23ffffff'/%3E%3Cpath d='M720 400 L700 410 L700 390 Z' fill='%23ffffff'/%3E%3Cpath d='M174 174 L190 186 L186 190 L174 174 Z' fill='%23ffffff'/%3E%3Cpath d='M626 626 L610 614 L614 610 L626 626 Z' fill='%23ffffff'/%3E%3Cpath d='M626 174 L614 190 L610 186 L626 174 Z' fill='%23ffffff'/%3E%3Cpath d='M174 626 L186 610 L190 614 L174 626 Z' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
}

/* Animated gears */
.gear-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gear {
    position: absolute;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.gear::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.gear-1 { width: 400px; height: 400px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.gear-2 { width: 300px; height: 300px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.gear-3 { width: 200px; height: 200px; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.gear-4 { width: 500px; height: 500px; top: 50%; left: 50%; transform: translate(-50%, -50%); }

.branding-content {
    width: 100%;
    height: 100%;
}

.branding-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.branding-logo {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.branding-logo img {
    max-width: 80%;
    max-height: 80%;
}

.branding-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--main-dark-royal, #034078);
    font-style: italic;
}

.branding-content h2 {
    font-size: 42px;
    font-weight: 300;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.branding-content h2 span {
    display: block;
}

.branding-content p {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

/* ══════════════════════════════════════════
   LOGIN PAGE - Ive Redesign (scoped)
   Progressive disclosure, one action per step
══════════════════════════════════════════ */

.login-ive {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 24px;
}

.ive-center {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo */
.ive-logo {
    width: 50%;
    margin-bottom: 40px;
}

.ive-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Steps */
.ive-step {
    width: 100%;
    display: none;
    opacity: 0;
    transform: translateY(8px);
}

.ive-step.active {
    display: block;
    animation: iveFadeIn 0.3s ease forwards;
}

@keyframes iveFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inputs */
.login-ive .ive-input {
    width: 100%;
    padding: 16px 0;
    border: none;
    border-bottom: 1px solid #d2d2d7;
    border-radius: 0;
    font-size: 17px;
    color: #1a1a1a;
    background: transparent;
    transition: border-color 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    font-family: inherit;
}

.login-ive .ive-input:focus {
    border-bottom-color: var(--accent-teal, #1282A2);
}

.login-ive .ive-input::placeholder {
    color: #86868b;
}

/* Password wrapper */
.ive-password-wrapper {
    position: relative;
    width: 100%;
}

.ive-password-wrapper .ive-input {
    padding-right: 44px;
}

.ive-password-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #86868b;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.ive-password-toggle:hover {
    color: #1a1a1a;
}

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

/* Primary button */
.login-ive .ive-btn-primary {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    background: #1a1a1a;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 24px;
    font-family: inherit;
}

.login-ive .ive-btn-primary:hover {
    background: #333333;
}

.login-ive .ive-btn-primary:active {
    transform: scale(0.98);
}

.login-ive .ive-btn-primary:disabled {
    background: #d2d2d7;
    color: #86868b;
    cursor: not-allowed;
    transform: none;
    animation: ivePulse 1.5s ease-in-out infinite;
}

@keyframes ivePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.8; }
}

/* Divider */
.login-ive .ive-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 24px 0;
    color: #86868b;
    font-size: 13px;
}

.login-ive .ive-divider::before,
.login-ive .ive-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5ea;
}

/* OAuth link */
.login-ive .ive-oauth-link {
    display: block;
    text-align: center;
    color: var(--accent-teal, #1282A2);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    padding: 8px;
    transition: color 0.2s ease;
}

.login-ive .ive-oauth-link:hover {
    color: var(--accent-navy, #001F54);
    text-decoration: underline;
}

/* Email badge (back button on step 2) */
.ive-email-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f5f5f7;
    border-radius: 20px;
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
    margin-bottom: 32px;
    border: none;
    transition: background 0.2s ease;
    font-family: inherit;
}

.ive-email-badge:hover {
    background: #e8e8ed;
}

.ive-email-badge svg {
    width: 14px;
    height: 14px;
    color: #86868b;
    flex-shrink: 0;
}

/* Back link (for OTP / forgot steps) */
.ive-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #86868b;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 24px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s ease;
}

.ive-back-link:hover {
    color: #1a1a1a;
}

.ive-back-link svg {
    width: 14px;
    height: 14px;
}

/* Secondary links row */
.ive-secondary-links {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 16px;
}

.ive-secondary-links a {
    color: var(--accent-teal, #1282A2);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.ive-secondary-links a:hover {
    text-decoration: underline;
}

/* Step description text */
.ive-step-desc {
    color: #86868b;
    font-size: 15px;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Footer link (sign up) */
.ive-footer-link {
    text-align: center;
    margin-top: 32px;
    font-size: 14px;
    color: #86868b;
}

.ive-footer-link a {
    color: var(--accent-teal, #1282A2);
    text-decoration: none;
    font-weight: 500;
}

.ive-footer-link a:hover {
    text-decoration: underline;
}

/* OTP code input */
.login-ive .ive-otp-input {
    width: 100%;
    padding: 16px 0;
    border: none;
    border-bottom: 1px solid #d2d2d7;
    border-radius: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 10px;
    text-align: center;
    color: #1a1a1a;
    background: transparent;
    transition: border-color 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    font-family: inherit;
}

.login-ive .ive-otp-input:focus {
    border-bottom-color: var(--accent-teal, #1282A2);
}

/* Timer text */
.ive-timer-row {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #86868b;
}

/* Resend link */
.ive-resend-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: var(--accent-teal, #1282A2);
    text-decoration: none;
    cursor: pointer;
}

.ive-resend-link:hover {
    text-decoration: underline;
}

/* Messages (override positioning within ive layout) */
.login-ive .auth-error-message,
.login-ive .auth-success-message {
    width: 100%;
    margin-bottom: 20px;
}

/* Minimal footer */
.ive-footer {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #86868b;
}

.ive-footer a {
    color: #86868b;
    text-decoration: none;
}

.ive-footer a:hover {
    color: #1a1a1a;
}

/* ── Ive Responsive ── */

@media (max-width: 480px) {
    .login-ive {
        padding: 16px;
        align-items: flex-start;
        padding-top: 60px;
    }

    .ive-center {
        max-width: 100%;
    }

    .ive-footer {
        position: relative;
        bottom: auto;
        margin-top: 48px;
    }
}

/* ══════════════════════════════════════════
   AUTH MODALS
══════════════════════════════════════════ */

.auth-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.auth-modal-overlay.show {
    display: flex;
}

.auth-modal {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-modal h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #1a202c;
}

.auth-modal p {
    color: #718096;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-modal .auth-form-group input {
    padding-left: 16px;
}

.auth-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.auth-modal-buttons .auth-btn {
    flex: 1;
}

.auth-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.auth-btn-cancel:hover {
    background: #e2e8f0;
}

/* ══════════════════════════════════════════
   CHANGE PASSWORD PAGE — Ive Design
══════════════════════════════════════════ */

.cpw-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 24px;
}

.cpw-center {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo — matches login page */
.cpw-logo {
    width: 50%;
    margin-bottom: 32px;
}

.cpw-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Title / Subtitle */
.cpw-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
    text-align: center;
}

.cpw-subtitle {
    font-size: 15px;
    color: #86868b;
    margin-bottom: 28px;
    text-align: center;
}

/* Messages */
.cpw-page .auth-error-message,
.cpw-page .auth-success-message {
    width: 100%;
    margin-bottom: 16px;
}

/* Form */
.cpw-form {
    width: 100%;
}

/* Inputs — underline style matching login */
.cpw-input {
    width: 100%;
    padding: 16px 0;
    border: none;
    border-bottom: 1px solid #d2d2d7;
    border-radius: 0;
    font-size: 17px;
    color: #1a1a1a;
    background: transparent;
    transition: border-color 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    font-family: inherit;
}

.cpw-input:focus {
    border-bottom-color: var(--accent-teal, #1282A2);
}

.cpw-input::placeholder {
    color: #86868b;
}

/* Password wrapper */
.cpw-pw-wrap {
    position: relative;
    width: 100%;
}

.cpw-pw-wrap .cpw-input {
    padding-right: 44px;
}

.cpw-pw-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #86868b;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.cpw-pw-toggle:hover {
    color: #1a1a1a;
}

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

/* Divider between current and new password sections */
.cpw-divider {
    width: 100%;
    height: 1px;
    background: #e5e5ea;
    margin: 24px 0 8px;
}

/* Strength bar */
.cpw-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cpw-strength.visible {
    opacity: 1;
}

.cpw-strength-bar {
    flex: 1;
    height: 4px;
    background: #e5e5ea;
    border-radius: 2px;
    overflow: hidden;
}

.cpw-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}

.cpw-strength-label {
    font-size: 12px;
    font-weight: 600;
    min-width: 48px;
    text-align: right;
    color: #86868b;
}

/* Requirement pills */
.cpw-reqs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.cpw-req {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f5f5f7;
    color: #86868b;
    transition: background 0.2s ease, color 0.2s ease;
}

.cpw-req.valid {
    background: #d1fae5;
    color: #059669;
}

/* Match indicator */
.cpw-match {
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
    transition: color 0.2s ease;
}

.cpw-match.match {
    color: #059669;
}

.cpw-match.no-match {
    color: #ef4444;
}

/* Submit button */
.cpw-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    background: #1a1a1a;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 24px;
    font-family: inherit;
}

.cpw-btn:hover {
    background: #333333;
}

.cpw-btn:active {
    transform: scale(0.98);
}

.cpw-btn:disabled {
    background: #d2d2d7;
    color: #86868b;
    cursor: not-allowed;
    transform: none;
}

/* Footer link */
.cpw-footer {
    margin-top: 32px;
    font-size: 14px;
    color: #86868b;
}

.cpw-footer a {
    color: var(--accent-teal, #1282A2);
    text-decoration: none;
    font-weight: 500;
}

.cpw-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .cpw-page {
        padding: 16px;
        align-items: flex-start;
        padding-top: 60px;
    }

    .cpw-center {
        max-width: 100%;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

@media (max-width: 1024px) {
    .branding-side {
        display: none;
    }

    .login-form-side {
        padding: 40px 24px;
    }

    .login-footer {
        left: 24px;
        right: 24px;
    }
}

@media (max-width: 480px) {
    .login-form-wrapper h1 {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .login-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
