/* =====================================================
   AI Auto Sites - Authentication Pages CSS
   Design: Modern Professional UI (2025)
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-bg: #eef2ff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background: #f1f5f9;
}

a { color: var(--primary); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--primary-dark); }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; }

/* ============ Auth Layout ============ */
.vp-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.vp-container {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.vp-login-row {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 100vh;
}

/* Left branding panel */
.vp-auth-img-wrap {
    flex: 1;
    background: linear-gradient(145deg, #312e81 0%, #4338ca 35%, #4f46e5 65%, #6366f1 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 56px;
    position: relative;
    overflow: hidden;
}

/* Large decorative circle top-right */
.vp-auth-img-wrap::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 420px;
    height: 420px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}

/* Decorative circle bottom-left */
.vp-auth-img-wrap::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -80px;
    width: 320px;
    height: 320px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

/* Extra decorative grid pattern */
.vp-auth-img-wrap .vp-auth-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.vp-auth-img {
    position: relative;
    z-index: 1;
    text-align: left;
    margin-bottom: 36px;
}

.vp-auth-img img { max-height: 260px; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.25)); }

.vp-auth-branding {
    position: relative;
    z-index: 1;
    text-align: left;
    color: #fff;
    max-width: 400px;
}

/* Badge pill above heading */
.vp-auth-branding .vp-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #c7d2fe;
    margin-bottom: 18px;
    backdrop-filter: blur(4px);
}

.vp-auth-branding .vp-auth-badge span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
}

.vp-auth-branding h2 {
    font-size: 34px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 14px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.vp-auth-branding p {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    max-width: 360px;
    margin: 0 0 32px;
    line-height: 1.75;
}

/* Feature checklist */
.vp-auth-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.vp-auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.vp-auth-features li .vp-check {
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vp-auth-features li .vp-check svg {
    width: 12px;
    height: 12px;
    stroke: #34d399;
    stroke-width: 2.5;
    fill: none;
}

/* Right form panel */
.vp-auth-content {
    width: 520px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 56px;
    background: #fff;
    position: relative;
}

/* ============ Login Form ============ */
.vp-login-form {
    width: 100%;
    max-width: 390px;
}

.vp-login-logo {
    margin-bottom: 36px;
}

.vp-login-logo img { max-height: 42px; }

.vp-login-form > h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.vp-login-form > h1 span { color: var(--primary); }

.vp-login-form > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

/* ============ Form Fields ============ */
.vp-input-box { margin-bottom: 6px; }

.vp-input-wrapper {
    margin-bottom: 14px;
    position: relative;
}

.vp-input-wrapper > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: static;
    cursor: default;
    overflow: visible;
    top: auto;
    left: auto;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

/* Default input — with LEFT icon space */
.vp-input-wrapper input,
.vp-input-wrapper select {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 48px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    color: var(--text-primary);
    background: #fff;
    outline: none;
    transition: 0.2s;
}

/* Password fields have toggle on RIGHT, no left icon */
.vp-input-wrapper:has(.vp_show_password) input {
    padding: 0 48px 0 16px;
}

.vp-input-wrapper input:focus,
.vp-input-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: #fafbff;
}

.vp-input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
}

/* Icon base — LEFT positioned (decorative icons: email, lock, etc.) */
.vp-input-wrapper .vp-login-icon {
    position: absolute;
    left: 14px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    pointer-events: none;
}

.vp-input-wrapper .vp-login-icon::before { display: none; }

.vp-input-wrapper .vp-login-icon svg {
    fill: none;
    stroke: currentColor;
    width: 17px;
    height: 17px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Password eye toggle — RIGHT positioned */
.vp-input-wrapper .vp-login-icon.vp_show_password {
    left: auto;
    right: 14px;
    cursor: pointer;
    pointer-events: all;
    color: var(--text-muted);
}

.vp-input-wrapper .vp-login-icon.vp_show_password:hover { color: var(--primary); }

/* ============ Remember & Forgot ============ */
.vp-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.vp-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.vp-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    position: static;
    opacity: 1;
    border: none;
    background: none;
    padding: 0;
    min-height: auto;
    border-radius: 0;
}

.vp-checkbox label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
    position: static;
    text-transform: none;
    letter-spacing: 0;
}

.vp-checkbox label::before, .vp-checkbox span::before { display: none; }
.vp-checkbox > label::after, .vp-checkbox > span::after { display: none; }

.vp-forgot a {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.vp-forgot a:hover { color: var(--primary-dark); }

/* ============ Button ============ */
.vp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-transform: none;
    min-width: auto;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.vp-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: 0.2s;
}

.vp-btn:hover::after { opacity: 1; }

.vp-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79,70,229,0.45);
}

.vp-btn:active { transform: translateY(0); box-shadow: none; }

.vp-btn:focus { outline: none; }

.vp-btn svg { stroke: currentColor; }

/* ============ Resend OTP ============ */
.vp-resend-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-muted);
}
.vp-resend-wrap button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}
.vp-resend-wrap button:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}
.vp-resend-wrap button:not(:disabled):hover { text-decoration: underline; }
#vp-resend-timer { font-size: 12px; font-weight: 400; }

/* ============ Go Back ============ */
.vp-goBack {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
}

.vp-goBack a {
    color: var(--text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    padding: 6px 12px;
    border-radius: 6px;
}

.vp-goBack a:hover { color: var(--primary); background: var(--primary-bg); }
.vp-goBack i { font-size: 12px; }

/* ============ Alert ============ */
.vp-alert-wrap {
    position: fixed;
    right: 24px;
    top: 24px;
    max-width: 380px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vp-alert-wrap.error,
.vp-alert-wrap.success {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.vp-alert-wrap > p {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 20px 16px 60px;
    margin: 0;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border-left: 4px solid var(--success);
}

.vp-alert-wrap.error > p { border-left-color: var(--danger); }

.vp-alert-wrap > p::before {
    content: "Success!";
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--success);
    margin-bottom: 2px;
}

.vp-alert-wrap.error > p::before { content: "Error!"; color: var(--danger); }

.vp-alert-wrap > p::after {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background-size: cover;
    background-position: center;
}

.vp-alert-wrap.success > p::after { background-image: url(../../images/happy.png); }
.vp-alert-wrap.error > p::after { background-image: url(../../images/sad.png); }

/* ============ Loader ============ */
.vp-loader {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
}

.vp-loader.show { display: flex; }

.vp-loader-box {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 20px;
    background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.18), transparent 55%),
                radial-gradient(circle at 70% 70%, rgba(14,165,233,0.2), transparent 55%),
                #0f172a;
    box-shadow: 0 20px 50px rgba(2,6,23,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(99,102,241,0.25);
}

.vp-loader-box img { display: none; }
.vp-loader-box::before {
    content: "";
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid rgba(129,140,248,0.35);
    border-top-color: #60a5fa;
    border-right-color: #22d3ee;
    box-shadow: 0 0 20px rgba(34,211,238,0.25);
    animation: vp-ai-rotate 1.2s linear infinite;
}
.vp-loader-box::after {
    content: "";
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 1px dashed rgba(148,163,184,0.35);
    animation: vp-ai-rotate 2.6s linear infinite reverse;
}
.vp-loader-box span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #a5b4fc;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(165,180,252,0.8);
    animation: vp-ai-pulse 1.4s ease-in-out infinite;
}
.vp-loader-box span:nth-child(1) { transform: translate(-26px, -10px); animation-delay: 0s; }
.vp-loader-box span:nth-child(2) { transform: translate(22px, -18px); animation-delay: 0.2s; }
.vp-loader-box span:nth-child(3) { transform: translate(10px, 26px); animation-delay: 0.4s; }
.vp-loader-box span:nth-child(4) { transform: translate(-18px, 22px); animation-delay: 0.6s; }

@keyframes vp-ai-rotate {
    to { transform: rotate(360deg); }
}
@keyframes vp-ai-pulse {
    0%, 100% { transform: scale(0.7) translate(var(--x, 0), var(--y, 0)); opacity: 0.6; }
    50% { transform: scale(1.2) translate(var(--x, 0), var(--y, 0)); opacity: 1; }
}

/* ============ Input Note ============ */
.vp-input-wrapper span a {
    font-size: 12px;
    color: var(--primary);
    margin-top: 4px;
    display: block;
    font-weight: 500;
}

/* Input value state - override old floating label */
.vp-input-wrapper.vp-input-value label,
label.vp-select-label {
    position: static;
    top: auto;
}
.vp-input-value input { border-color: var(--border); }

.vp-divider {
    position: relative;
    margin: 10px 0;
    font-weight: 600;
    text-align: center;
}
.vp-divider:before {
    content: "";
    height: 1px;
    left: 0;
    right: 0;
    background: var(--border);
    position: absolute;
    top: 50%;
}
.vp-divider span {
    background: #fff;
    padding: 0 16px;
    position: relative;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .vp-auth-img-wrap { display: none; }
    .vp-auth-content { width: 100%; padding: 40px 30px; }
    .vp-login-form { max-width: 100%; }
}

@media (max-width: 480px) {
    .vp-auth-content { padding: 30px 20px; }
    .vp-login-form > h1 { font-size: 22px; }
    .vp-remember { flex-direction: column; align-items: flex-start; gap: 12px; }
}
