/**
 * TopLog Catering - Authentication Styles (Login / Register)
 * Pixel-perfect design based on React reference
 *
 * @since 2.6.0
 */

/* ==================== VARIABLES ==================== */
:root {
    --tlc-auth-primary: #343388;
    --tlc-auth-primary-hover: #2c2b75;
    --tlc-auth-bg: #f3f4f6;
    --tlc-auth-input-bg: #f9fafb;
    --tlc-auth-inactive-tab: #e5e7eb;
    --tlc-auth-warning-bg: #FFFBE6;
    --tlc-auth-warning-border: #FFE58F;
    --tlc-auth-text-dark: #1f2937;
    --tlc-auth-text-muted: #6b7280;
    --tlc-auth-placeholder: #9ca3af;
    --tlc-auth-border: #e5e7eb;
    --tlc-auth-white: #ffffff;
    --tlc-auth-success: #10b981;
    --tlc-auth-error: #ef4444;
    --tlc-auth-error-bg: #fef2f2;
    --tlc-auth-radius-card: 24px;
    --tlc-auth-radius-input: 12px;
    --tlc-auth-radius-btn: 12px;
    --tlc-auth-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --tlc-auth-shadow-btn: 0 10px 15px -3px rgba(52, 51, 136, 0.3), 0 4px 6px -4px rgba(52, 51, 136, 0.3);
}

/* ==================== WRAPPER ==================== */
.tlc-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tlc-auth-bg);
    padding: 24px 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tlc-auth-container {
    width: 100%;
    max-width: 896px;
}

/* ==================== TABS ==================== */
.tlc-auth-tabs {
    display: flex;
    position: relative;
    z-index: 2;
    margin-left: 24px;
}

.tlc-auth-tab {
    padding: 12px 32px;
    font-weight: 700;
    font-size: 18px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    font-family: inherit;
    line-height: 1.4;
    position: relative;
}

.tlc-auth-tab.active {
    background: var(--tlc-auth-primary);
    color: var(--tlc-auth-white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

.tlc-auth-tab:not(.active) {
    background: var(--tlc-auth-inactive-tab);
    color: var(--tlc-auth-text-muted);
    border: 1px solid #d1d5db;
    border-bottom: none;
    z-index: 1;
}

.tlc-auth-tab:not(.active):hover {
    background: #d1d5db;
    color: var(--tlc-auth-text-dark);
}

/* ==================== CARD ==================== */
.tlc-auth-card {
    background: var(--tlc-auth-white);
    border-radius: var(--tlc-auth-radius-card);
    box-shadow: var(--tlc-auth-shadow);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

/* ==================== PANELS ==================== */
.tlc-auth-panel {
    display: none;
}

.tlc-auth-panel.active {
    display: block;
    animation: tlcAuthFadeIn 0.3s ease;
}

@keyframes tlcAuthFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== HEADER (Purple) ==================== */
.tlc-auth-header {
    background: var(--tlc-auth-primary);
    padding: 32px 40px;
    position: relative;
    overflow: hidden;
}

.tlc-auth-header-circle {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.tlc-auth-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.tlc-auth-header-left {
    flex: 1;
}

.tlc-auth-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    color: var(--tlc-auth-white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.tlc-auth-title {
    color: var(--tlc-auth-white);
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.tlc-auth-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tlc-auth-subtitle svg {
    opacity: 0.7;
    flex-shrink: 0;
}

/* Status Indicator */
.tlc-auth-status {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
    flex-shrink: 0;
    margin-left: 24px;
}

.tlc-auth-status-label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
}

.tlc-auth-status-value {
    color: var(--tlc-auth-white);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tlc-auth-status-dot {
    width: 10px;
    height: 10px;
    background: var(--tlc-auth-success);
    border-radius: 50%;
    display: inline-block;
    animation: tlcAuthPulse 2s ease-in-out infinite;
}

@keyframes tlcAuthPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* ==================== BODY (Form area) ==================== */
.tlc-auth-body {
    padding: 32px 40px 40px;
}

/* ==================== ERROR MESSAGE ==================== */
.tlc-auth-error {
    background: var(--tlc-auth-error-bg);
    border: 1px solid #fecaca;
    color: var(--tlc-auth-error);
    border-radius: var(--tlc-auth-radius-input);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    display: block;
}

.tlc-auth-error ul {
    margin: 4px 0 0 0;
    padding-left: 18px;
    font-weight: 400;
}

.tlc-auth-error ul li {
    margin-bottom: 2px;
}

/* ==================== FORM FIELDS ==================== */
.tlc-auth-field {
    margin-bottom: 20px;
}

.tlc-auth-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--tlc-auth-text-dark);
    margin-bottom: 6px;
}

.tlc-auth-input-wrap {
    position: relative;
}

.tlc-auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tlc-auth-placeholder);
    pointer-events: none;
    z-index: 1;
}

.tlc-auth-input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: var(--tlc-auth-input-bg);
    border: 1px solid var(--tlc-auth-border);
    border-radius: var(--tlc-auth-radius-input);
    font-size: 16px;
    font-family: inherit;
    color: var(--tlc-auth-text-dark);
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

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

.tlc-auth-input:focus {
    background: var(--tlc-auth-white);
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--tlc-auth-primary);
}

.tlc-auth-input.has-error {
    border-color: var(--tlc-auth-error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.tlc-auth-field-footer {
    text-align: right;
    margin-top: 6px;
}

.tlc-auth-link {
    color: var(--tlc-auth-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

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

.tlc-auth-field-info {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f9ff;
    border-radius: 8px;
    font-size: 12px;
    color: #0369a1;
    line-height: 1.5;
}

.tlc-auth-field-info svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #0ea5e9;
}

/* ==================== GRID (Register 2 cols) ==================== */
.tlc-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 8px;
}

.tlc-auth-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--tlc-auth-text-dark);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tlc-auth-border);
    margin-bottom: 20px;
}

.tlc-auth-section-title svg {
    color: var(--tlc-auth-text-muted);
}

/* ==================== WARNING BOX ==================== */
.tlc-auth-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--tlc-auth-warning-bg);
    border: 1px solid var(--tlc-auth-warning-border);
    border-radius: var(--tlc-auth-radius-input);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.tlc-auth-warning-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.tlc-auth-warning strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tlc-auth-warning p {
    margin: 0;
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
}

/* ==================== SUBMIT BUTTON ==================== */
.tlc-auth-submit {
    width: 100%;
    background: var(--tlc-auth-primary);
    color: var(--tlc-auth-white);
    font-weight: 700;
    font-size: 16px;
    font-family: inherit;
    padding: 16px 32px;
    border-radius: var(--tlc-auth-radius-btn);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.25s ease;
    box-shadow: var(--tlc-auth-shadow-btn);
    line-height: 1.4;
}

.tlc-auth-submit:hover {
    background: var(--tlc-auth-primary-hover);
    transform: scale(1.02);
}

.tlc-auth-submit:active {
    transform: scale(0.98);
}

.tlc-auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tlc-auth-submit svg {
    flex-shrink: 0;
}

/* Loading Spinner */
.tlc-auth-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--tlc-auth-white);
    border-radius: 50%;
    animation: tlcAuthSpin 0.6s linear infinite;
}

@keyframes tlcAuthSpin {
    to { transform: rotate(360deg); }
}

/* ==================== SWITCH LINK ==================== */
.tlc-auth-switch {
    text-align: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--tlc-auth-border, #e5e7eb);
    font-size: 14px;
    color: var(--tlc-auth-text-muted);
}

.tlc-auth-switch-link {
    color: var(--tlc-auth-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .tlc-auth-wrapper {
        padding: 16px 12px;
        align-items: flex-start;
        min-height: auto;
    }

    .tlc-auth-container {
        max-width: 100%;
    }

    .tlc-auth-tabs {
        margin-left: 16px;
    }

    .tlc-auth-tab {
        padding: 10px 20px;
        font-size: 15px;
    }

    .tlc-auth-header {
        padding: 24px 20px;
    }

    .tlc-auth-header-content {
        flex-direction: column;
        gap: 16px;
    }

    .tlc-auth-status {
        margin-left: 0;
        align-self: flex-start;
    }

    .tlc-auth-title {
        font-size: 22px;
    }

    .tlc-auth-body {
        padding: 24px 20px 32px;
    }

    .tlc-auth-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .tlc-auth-section-title {
        margin-top: 16px;
    }

    .tlc-auth-col:first-child .tlc-auth-section-title {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .tlc-auth-tabs {
        margin-left: 12px;
    }

    .tlc-auth-tab {
        padding: 8px 16px;
        font-size: 14px;
    }

    .tlc-auth-header {
        padding: 20px 16px;
    }

    .tlc-auth-title {
        font-size: 20px;
    }

    .tlc-auth-body {
        padding: 20px 16px 28px;
    }

    .tlc-auth-submit {
        padding: 14px 24px;
        font-size: 15px;
    }
}

/* ==================== WP OVERRIDES ==================== */
/* Remove default WP page padding/margins when using auth template */
.tlc-auth-wrapper * {
    box-sizing: border-box;
}

/* Fix WP themes that add extra styling */
.tlc-auth-wrapper input[type="email"],
.tlc-auth-wrapper input[type="text"],
.tlc-auth-wrapper input[type="password"],
.tlc-auth-wrapper input[type="tel"] {
    height: auto;
    min-height: 50px;
    box-shadow: none;
    margin: 0;
    padding-left: 46px;
}

.tlc-auth-wrapper button {
    box-shadow: var(--tlc-auth-shadow-btn);
}

.tlc-auth-wrapper a {
    box-shadow: none;
}

/* Hide WP admin bar space on auth page */
.tlc-auth-wrapper {
    margin-top: 0 !important;
}
