/* ==========================================================================
   MyShop Identity Auth Theme
   Unified Modern Aesthetic for Login, Register, Password Recovery, OTP & Verification
   Fully aligned with Matrix Storefront Design System (Light & Dark Mode)
   ========================================================================== */

:root {
    --auth-primary: #1e64b8;
    --auth-primary-hover: #185296;
    --auth-primary-gradient: linear-gradient(135deg, #1e64b8 0%, #2563eb 100%);
    --auth-accent-gradient: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    --auth-surface: #ffffff;
    --auth-surface-subtle: #f8fafc;
    --auth-surface-hover: #f1f5f9;
    --auth-border: #e2e8f0;
    --auth-border-focus: #3b82f6;
    --auth-text-main: #0f172a;
    --auth-text-muted: #64748b;
    --auth-text-subtle: #94a3b8;
    --auth-card-shadow: 0 20px 45px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.05);
    --auth-glow: rgba(30, 100, 184, 0.12);
}

[data-bs-theme="dark"] {
    --auth-primary: #3b82f6;
    --auth-primary-hover: #60a5fa;
    --auth-primary-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --auth-accent-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    --auth-surface: #111827;
    --auth-surface-subtle: #1f2937;
    --auth-surface-hover: #263346;
    --auth-border: #1f2937;
    --auth-border-focus: #60a5fa;
    --auth-text-main: #f8fafc;
    --auth-text-muted: #94a3b8;
    --auth-text-subtle: #64748b;
    --auth-card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --auth-glow: rgba(59, 130, 246, 0.2);
}

/* Page Wrapper */
.auth-wrapper {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    position: relative;
    overflow: hidden;
    background-color: var(--store-surface-muted, #f8fafc);
    background-image: 
        radial-gradient(at 15% 15%, var(--auth-glow) 0px, transparent 45%),
        radial-gradient(at 85% 85%, rgba(37, 99, 235, 0.05) 0px, transparent 40%);
}

[data-bs-theme="dark"] .auth-wrapper {
    background-color: #0b0f19;
    background-image: 
        radial-gradient(at 15% 15%, rgba(59, 130, 246, 0.12) 0px, transparent 45%),
        radial-gradient(at 85% 85%, rgba(30, 100, 184, 0.08) 0px, transparent 40%);
}

/* Card Container */
.auth-box {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.auth-box--wide {
    max-width: 530px;
}

/* Auth Card */
.auth-card {
    background: var(--auth-surface);
    border-radius: 1.25rem;
    border: 1px solid var(--auth-border);
    box-shadow: var(--auth-card-shadow);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    backdrop-filter: blur(12px);
}

/* Header Section */
.auth-card-header {
    padding: 2.25rem 2rem 1.5rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--auth-border);
    background: linear-gradient(180deg, var(--auth-surface-subtle) 0%, var(--auth-surface) 100%);
}

.auth-brand-avatar {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 1rem;
    background: var(--auth-primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 20px -5px rgba(30, 100, 184, 0.35);
    transition: transform 0.25s ease;
}

.auth-card:hover .auth-brand-avatar {
    transform: scale(1.05);
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgba(30, 100, 184, 0.08);
    color: var(--auth-primary);
    border: 1px solid rgba(30, 100, 184, 0.16);
    margin-bottom: 0.75rem;
}

[data-bs-theme="dark"] .auth-badge {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--auth-text-main);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--auth-text-muted);
    margin-bottom: 0;
    line-height: 1.5;
}

/* Body Section */
.auth-card-body {
    padding: 1.75rem 2rem 2rem;
}

/* Form Controls */
.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.81rem;
    font-weight: 600;
    color: var(--auth-text-main);
    margin-bottom: 0.45rem;
}

.auth-label-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-label-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

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

.auth-input-icon {
    position: absolute;
    left: 1rem;
    color: var(--auth-text-subtle);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 2;
}

.auth-input {
    width: 100%;
    height: 46px;
    padding: 0.65rem 1rem 0.65rem 2.65rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--auth-text-main);
    background-color: var(--auth-surface-subtle);
    border: 1px solid var(--auth-border);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    outline: none;
}

.auth-input::placeholder {
    color: var(--auth-text-subtle);
}

.auth-input:focus {
    background-color: var(--auth-surface);
    border-color: var(--auth-border-focus);
    box-shadow: 0 0 0 3px rgba(30, 100, 184, 0.15);
}

[data-bs-theme="dark"] .auth-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--auth-primary);
}

/* Password Toggle Eye Button */
.auth-password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--auth-text-subtle);
    cursor: pointer;
    padding: 0.4rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: color 0.15s ease;
    z-index: 3;
}

.auth-password-toggle:hover {
    color: var(--auth-text-main);
}

/* Checkbox */
.auth-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
}

.auth-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-primary);
    border-radius: 0.35rem;
    cursor: pointer;
}

.auth-checkbox-label {
    font-size: 0.83rem;
    color: var(--auth-text-muted);
    cursor: pointer;
    margin-bottom: 0;
    user-select: none;
}

/* Action Buttons */
.auth-btn-primary {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 0.75rem;
    background: var(--auth-primary-gradient);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(30, 100, 184, 0.3);
}

.auth-btn-primary:hover {
    background: linear-gradient(135deg, #185296 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(30, 100, 184, 0.4);
    color: #ffffff;
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-secondary {
    width: 100%;
    height: 44px;
    border: 1px solid var(--auth-border);
    border-radius: 0.75rem;
    background: var(--auth-surface-subtle);
    color: var(--auth-text-main);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
    text-decoration: none;
}

.auth-btn-secondary:hover {
    background: var(--auth-surface-hover);
    border-color: var(--auth-border-focus);
    color: var(--auth-primary);
}

/* Social Buttons */
.auth-social-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.auth-social-btn {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: var(--auth-surface-subtle);
    border: 1px solid var(--auth-border);
    border-radius: 0.75rem;
    color: var(--auth-text-main);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-social-btn:hover {
    background: var(--auth-surface-hover);
    border-color: var(--auth-border-focus);
    transform: translateY(-1px);
}

.auth-social-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-social-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.auth-social-icon.google { color: #ea4335; }
.auth-social-icon.facebook { color: #1877f2; }
.auth-social-icon.microsoft { color: #00a4ef; }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--auth-text-subtle);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--auth-border);
}

.auth-divider span {
    padding: 0 0.85rem;
}

/* Links & Footer */
.auth-links-group {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    text-align: center;
}

.auth-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link:hover {
    color: var(--auth-primary);
}

.auth-link--highlight {
    font-weight: 700;
    color: var(--auth-primary);
}

.auth-link--highlight:hover {
    text-decoration: underline;
}

/* Security Trust Strip */
.auth-trust-strip {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--auth-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.74rem;
    color: var(--auth-text-subtle);
    flex-wrap: wrap;
}

.auth-trust-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Validation Styling */
.auth-validation-summary {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 500;
}

[data-bs-theme="dark"] .auth-validation-summary {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.auth-field-error {
    font-size: 0.74rem;
    color: #dc2626;
    margin-top: 0.3rem;
    display: block;
    font-weight: 500;
}

[data-bs-theme="dark"] .auth-field-error {
    color: #f87171;
}

/* Status Alert */
.auth-status-alert {
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.84rem;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.auth-status-alert--info {
    background: rgba(30, 100, 184, 0.08);
    border: 1px solid rgba(30, 100, 184, 0.2);
    color: var(--auth-primary);
}

.auth-status-alert--success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #059669;
}

[data-bs-theme="dark"] .auth-status-alert--success {
    color: #34d399;
}

/* Password Strength Indicator */
.auth-strength-meter {
    margin-top: 0.5rem;
}

.auth-strength-bars {
    display: flex;
    gap: 4px;
    height: 4px;
    margin-bottom: 0.35rem;
}

.auth-strength-bar {
    flex: 1;
    background: var(--auth-border);
    border-radius: 2px;
    transition: background-color 0.25s ease;
}

.auth-strength-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--auth-text-muted);
}

/* OTP Code Input Box */
.auth-otp-input {
    letter-spacing: 0.5em;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    padding-left: 1.5rem !important;
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .auth-wrapper {
        padding: 1.25rem 0.75rem;
    }

    .auth-card-header {
        padding: 1.75rem 1.25rem 1.25rem;
    }

    .auth-card-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .auth-title {
        font-size: 1.4rem;
    }
}
