/* ===================================
   MODERN AUTH - PREMIUM E-COMMERCE LOGIN
   Inspired by Amazon, Shopee, Flipkart, Tokopedia
   =================================== */

:root {
    --auth-primary: #FF6B35;
    --auth-primary-hover: #E55A2B;
    --auth-primary-light: #FFF4EF;
    --auth-primary-glow: rgba(255, 107, 53, 0.15);
    --auth-text: #1a1a2e;
    --auth-text-secondary: #5a5a72;
    --auth-text-muted: #9ca3af;
    --auth-border: #e8e8ef;
    --auth-border-hover: #d0d0dc;
    --auth-bg: #f8f9fc;
    --auth-white: #ffffff;
    --auth-success: #10b981;
    --auth-error: #ef4444;
    --auth-warning: #f59e0b;
    --auth-radius: 14px;
    --auth-radius-sm: 10px;
    --auth-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --auth-shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --auth-shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --auth-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }

body.auth-page-body {
    margin: 0;
    padding: 0;
    background: var(--auth-bg);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.auth-page-body,
body.auth-page-body .ps-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.modern-auth-container {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    width: 100%;
}

/* ===================================
   MAIN CARD - TWO COLUMN LAYOUT
   =================================== */

.modern-auth-card {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    width: 100%;
    min-height: 100vh;
    background: var(--auth-white);
}

/* ===================================
   LEFT COLUMN - BRAND HERO PANEL
   =================================== */

.auth-hero {
    position: relative;
    background: linear-gradient(160deg, #f4f8fc 0%, #eaf0f7 40%, #e2ecf5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 50px;
    overflow: hidden;
}

/* Decorative Blobs */
.hero-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
}

.blob--1 {
    width: 300px;
    height: 300px;
    background: #b8d4f0;
    top: -80px;
    right: -60px;
    animation: blobFloat1 12s ease-in-out infinite;
}

.blob--2 {
    width: 200px;
    height: 200px;
    background: #a3c4e8;
    bottom: 10%;
    left: -40px;
    animation: blobFloat2 15s ease-in-out infinite;
}

.blob--3 {
    width: 150px;
    height: 150px;
    background: #c8ddf2;
    top: 50%;
    right: 20%;
    animation: blobFloat3 10s ease-in-out infinite;
}

@keyframes blobFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, 40px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes blobFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.15); }
}

@keyframes blobFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, 20px) scale(1.1); }
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 480px;
    width: 100%;
}

/* Logo */
.hero-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-bottom: 40px;
}

.hero-logo__img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.hero-logo__text {
    font-size: 26px;
    font-weight: 800;
    color: var(--auth-text);
    letter-spacing: -0.03em;
}

/* Headline */
.hero-headline {
    margin-bottom: 40px;
}

.hero-headline__title {
    font-size: 42px;
    font-weight: 900;
    color: var(--auth-text);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0 0 16px 0;
}

.hero-headline__sub {
    font-size: 16px;
    color: var(--auth-text-secondary);
    line-height: 1.6;
    margin: 0;
    max-width: 400px;
}

/* Feature Cards */
.hero-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--auth-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: var(--auth-transition);
}

.hero-feature:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(6px);
    box-shadow: var(--auth-shadow-md);
}

.hero-feature__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-feature__icon--delivery {
    background: #EBF5FF;
    color: #2563eb;
}

.hero-feature__icon--secure {
    background: #ECFDF5;
    color: #059669;
}

.hero-feature__icon--returns {
    background: #FFF7ED;
    color: #ea580c;
}

.hero-feature div strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 2px;
}

.hero-feature div span {
    font-size: 12.5px;
    color: var(--auth-text-secondary);
}

/* Social Proof */
.hero-proof {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-proof__avatars {
    display: flex;
}

.proof-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid white;
    margin-left: -8px;
}

.proof-avatar:first-child {
    margin-left: 0;
}

.hero-proof__text {
    font-size: 13px;
    color: var(--auth-text-secondary);
    line-height: 1.4;
}

.hero-proof__text strong {
    color: var(--auth-text);
    font-weight: 700;
}

/* ===================================
   RIGHT COLUMN - FORM AREA
   =================================== */

.auth-form-column {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--auth-white);
}

.auth-form-card {
    width: 100%;
    max-width: 420px;
}

/* Header */
.auth-header {
    margin-bottom: 28px;
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--auth-text);
    margin: 0 0 8px 0;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--auth-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Steps / Animation */
.auth-step {
    display: none;
    animation: stepSlideIn 0.35s ease-out;
}

.auth-step.active {
    display: block;
}

@keyframes stepSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--auth-border);
}

.auth-divider span {
    position: relative;
    background: var(--auth-white);
    padding: 0 16px;
    font-size: 12px;
    color: var(--auth-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===================================
   FORM ELEMENTS
   =================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

/* Input with Icon */
.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 1;
}

.input-icon-wrapper:focus-within .input-icon {
    color: var(--auth-primary);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--auth-text);
    background: var(--auth-white);
    transition: var(--auth-transition);
    outline: none;
}

.form-input--icon {
    padding-left: 46px;
}

.form-input--password {
    padding-right: 48px;
}

.form-input::placeholder {
    color: var(--auth-text-muted);
    font-weight: 400;
}

/* Override Chrome autofill yellow background */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: var(--auth-text) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-input:hover {
    border-color: var(--auth-border-hover);
}

.form-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-glow);
}

.form-error {
    font-size: 12px;
    color: var(--auth-error);
    min-height: 0;
    margin-top: 2px;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 48px;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--auth-text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 1;
}

.btn-toggle-password:hover {
    color: var(--auth-primary);
}

/* Password Strength */
.password-strength {
    margin-top: 6px;
}

.strength-bar {
    height: 3px;
    background: var(--auth-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.strength-fill.weak {
    width: 33%;
    background: var(--auth-error);
}

.strength-fill.medium {
    width: 66%;
    background: var(--auth-warning);
}

.strength-fill.strong {
    width: 100%;
    background: var(--auth-success);
}

.strength-text {
    font-size: 11px;
    color: var(--auth-text-muted);
}

/* ===================================
   BUTTONS
   =================================== */

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--auth-primary);
    color: white;
    border: none;
    border-radius: var(--auth-radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--auth-transition);
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--auth-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.25);
}

/* Shimmer Effect */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-continue {
    margin-top: 4px;
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--auth-text-secondary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 0;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}

.btn-back:hover {
    color: var(--auth-primary);
}

/* ===================================
   FORM OPTIONS
   =================================== */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin: 2px 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--auth-text);
    position: relative;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--auth-primary);
    border-radius: 4px;
}

.terms-checkbox {
    margin: 4px 0;
}

.terms-checkbox a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

.link-forgot,
.link-forgot:visited {
    color: var(--auth-primary) !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.2s ease;
    cursor: pointer;
}

.link-forgot:hover,
.link-forgot:focus,
.link-forgot:active {
    color: var(--auth-primary-hover) !important;
    text-decoration: underline !important;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 14px;
}

/* Footer */
.auth-footer {
    margin-top: 16px;
    text-align: center;
}

.link-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link-back:hover {
    color: var(--auth-primary);
}

/* ===================================
   USER INFO (Login Step)
   =================================== */

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--auth-primary-light);
    border-radius: var(--auth-radius-sm);
    border: 1px solid rgba(255, 107, 53, 0.08);
}

.user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--auth-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.user-greeting {
    font-size: 12px;
    color: var(--auth-text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
}

.user-email {
    font-size: 15px;
    font-weight: 700;
    color: var(--auth-text);
}

/* ===================================
   REGISTER HEADER
   =================================== */

.register-header {
    margin-bottom: 20px;
}

.register-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--auth-text);
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.register-subtitle {
    font-size: 14px;
    color: var(--auth-text-secondary);
    margin: 0;
}

/* Forgot Icon */
.forgot-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--auth-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--auth-primary);
}

.forgot-success-content {
    text-align: center;
    padding: 8px 0;
}

.forgot-success-icon {
    margin: 0 auto 16px;
}

/* ===================================
   TRUST BADGES
   =================================== */

.trust-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-border);
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--auth-text-muted);
    font-weight: 500;
}

.trust-badge svg {
    color: var(--auth-success);
    flex-shrink: 0;
}

.trust-badge-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--auth-border);
}

/* ===================================
   SOCIAL LOGIN PLUGIN INTEGRATION
   =================================== */

.login-options {
    margin-bottom: 0;
}

.login-options-title {
    display: none;
}

.social-login-basic,
.social-icons {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-login-basic li,
.social-icons li {
    margin: 0;
}

.social-login-basic a,
.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    background: var(--auth-white);
    transition: var(--auth-transition);
}

.social-login-basic a:hover,
.social-icons a:hover {
    border-color: var(--auth-border-hover);
    background: #fafafa;
    transform: translateY(-1px);
    box-shadow: var(--auth-shadow-sm);
}

.social-login-basic a img,
.social-icons a img,
.social-login-basic a svg,
.social-icons a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* OR Divider (generated by social login + form adjacency) */
.login-options + form::before {
    content: 'OR';
    display: block;
    position: relative;
    text-align: center;
    margin: 16px 0;
    font-size: 11px;
    color: var(--auth-text-muted);
    font-weight: 600;
    letter-spacing: 0.08em;
}

.login-options + form::before::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--auth-border);
    z-index: -1;
}

.login-options + form::before {
    background: var(--auth-white);
    padding: 0 14px;
    display: inline-block;
    width: auto;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* ===================================
   LOADING STATE
   =================================== */

.btn-primary.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-primary.loading span,
.btn-primary.loading svg {
    visibility: hidden;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   ALERTS
   =================================== */

.alert {
    padding: 12px 16px;
    border-radius: var(--auth-radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-success {
    background: #ECFDF5;
    color: #065f46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FEF2F2;
    color: #991b1b;
    border: 1px solid #FECACA;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 1024px) {
    .auth-hero {
        padding: 40px 36px;
    }

    .hero-headline__title {
        font-size: 34px;
    }
}

@media (max-width: 768px) {
    .modern-auth-card {
        grid-template-columns: 1fr;
    }

    .auth-hero {
        display: none;
    }

    .auth-form-column {
        padding: 32px 24px;
        min-height: 100vh;
    }

    .auth-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .modern-auth-container {
        padding: 0;
    }

    .auth-form-column {
        padding: 28px 20px;
    }

    .auth-title {
        font-size: 22px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .form-input--icon {
        padding-left: 42px;
    }

    .btn-primary {
        padding: 13px 20px;
        font-size: 14px;
    }

    .trust-badges {
        flex-wrap: wrap;
        gap: 8px;
    }

    .trust-badge-dot {
        display: none;
    }
}

/* ===================================
   CAROUSEL LEGACY (keep for JS compat)
   =================================== */

.auth-carousel { display: none; }
.carousel-slide { display: none; }
.carousel-indicators { display: none; }

/* ===================================
   GUEST CHECKOUT OPTION
   =================================== */

.guest-checkout-option {
    text-align: center;
}

.btn-guest-checkout {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: var(--auth-white) !important;
    color: var(--auth-text) !important;
    border: 2px solid var(--auth-border) !important;
    border-radius: var(--auth-radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    transition: var(--auth-transition);
    text-decoration: none !important;
}

.btn-guest-checkout:hover {
    border-color: var(--auth-text) !important;
    background: var(--auth-bg) !important;
    color: var(--auth-text) !important;
    transform: translateY(-1px);
    box-shadow: var(--auth-shadow-md);
}

.btn-guest-checkout svg:first-child {
    opacity: 0.6;
}

.btn-guest-checkout .checkout-arrow {
    margin-left: auto;
    opacity: 0.4;
    transition: var(--auth-transition);
}

.btn-guest-checkout:hover .checkout-arrow {
    opacity: 1;
    transform: translateX(3px);
}

.guest-checkout-note {
    margin: 10px 0 0 !important;
    font-size: 12px;
    color: var(--auth-text-muted);
    line-height: 1.4;
}
