/* ============================================
   SLOXLY — Seller Authentication Pages
   Exact mirror of user auth.css design
   All colors from seller_theme database
   ============================================ */

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover, a:focus, a:visited { text-decoration: none; }

/* ---- Page Layout ---- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 20px;
}

.auth-container {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
    animation: authFadeIn 0.5s ease;
}

.auth-container-wide {
    max-width: 540px;
}

.auth-container-terms {
    max-width: 720px;
}

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

/* ---- Card ---- */
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px 0 16px 16px;
    clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%);
    padding: 40px;
    position: relative;
}

.auth-card-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    background: var(--primary);
    z-index: 1;
}

/* ---- Auth Header ---- */
.auth-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ---- Auth Footer ---- */
.auth-bottom-bar {
    text-align: center;
    margin-top: 20px;
    font-size: 0.74rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ---- Logo ---- */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.auth-logo a {
    text-decoration: none;
    color: var(--text);
}

.auth-logo img {
    height: 36px;
    width: auto;
}

.auth-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

/* ---- Portal Badge ---- */
.auth-portal-badge {
    display: block;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 24px;
}

/* ---- Title ---- */
.auth-title {
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ---- Alert ---- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px 0 10px 10px;
    font-size: 0.84rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.auth-alert svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.auth-alert-success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

/* ---- Form Group ---- */
.auth-form-group {
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ---- Input Wrap ---- */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    pointer-events: none;
    flex-shrink: 0;
    transition: color 0.2s;
}

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

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px 0 10px 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.auth-input:hover {
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

/* ---- Textarea ---- */
textarea.auth-input {
    height: auto;
    padding: 12px 14px 12px 42px;
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

/* ---- Select ---- */
.auth-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.auth-select option {
    background: var(--card);
    color: var(--text);
}

/* ---- Avatar Upload ---- */
.auth-avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px 0 12px 12px;
    transition: border-color 0.2s;
}

.auth-avatar-upload:hover {
    border-color: var(--primary);
}

.auth-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: border-color 0.2s;
}

.auth-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-avatar-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
    border-radius: 8px 0 8px 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.auth-avatar-btn:hover {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
}

.auth-avatar-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}


/* ---- Password Toggle ---- */
.auth-pw-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    border-radius: 6px 3px 6px 3px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s, background 0.2s;
}

.auth-pw-toggle:hover {
    color: var(--text);
    background: var(--surface);
}

/* ---- Grid ---- */
.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ---- Row ---- */
.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-link {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
}

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

/* ---- Checkbox ---- */
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 20px;
    line-height: 1.6;
}

.auth-check input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    min-width: 16px;
    flex-shrink: 0;
}

.auth-check a {
    color: var(--primary);
    font-weight: 500;
    white-space: nowrap;
}

.auth-check a:hover {
    text-decoration: underline;
}

/* ---- Primary Button ---- */
.auth-btn {
    width: 100%;
    height: 48px;
    padding: 0 24px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--btn-text);
    background: var(--primary);
    border: none;
    border-radius: 12px 0 12px 12px;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    text-align: center;
}

a.auth-btn,
a.auth-btn:hover,
a.auth-btn:focus,
a.auth-btn:visited {
    text-decoration: none;
    color: var(--btn-text);
}

.auth-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

/* ---- Footer Links ---- */
.auth-footer-text {
    text-align: center;
    margin-top: 22px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-footer-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-text a:hover {
    opacity: 0.85;
}

.auth-footer-alt {
    margin-top: 10px;
    font-size: 0.8rem;
}

/* ---- Password Strength Meter ---- */
.auth-meter {
    height: 4px;
    background: var(--surface);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.auth-meter-fill {
    height: 100%;
    border-radius: 2px;
    transition: all 0.3s ease;
    width: 0;
}

.auth-meter-fill.weak { width: 25%; background: #ef4444; }
.auth-meter-fill.fair { width: 50%; background: var(--warning, #f59e0b); }
.auth-meter-fill.good { width: 75%; background: #3b82f6; }
.auth-meter-fill.strong { width: 100%; background: var(--success, #22c55e); }

.auth-meter-text {
    font-size: 0.72rem;
    margin-top: 4px;
    display: block;
    color: var(--text-secondary);
}

/* ---- Success State ---- */
.auth-success-state {
    text-align: center;
}

.auth-success-badge {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--success, #22c55e), #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: authBounce 0.5s ease;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
}

.auth-success-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 24px 0;
    text-align: left;
}

.auth-success-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text);
}

.auth-step-num {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--btn-text);
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Legacy success icon (forgot password) */
.auth-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: authBounce 0.5s ease;
}

@keyframes authBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ---- Terms Page ---- */
.auth-terms-section {
    margin-bottom: 24px;
}

.auth-terms-section:last-of-type {
    margin-bottom: 0;
}

.auth-terms-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.auth-terms-heading svg {
    color: var(--primary);
    flex-shrink: 0;
}

.auth-terms-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-terms-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.auth-terms-list li svg {
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--primary);
}

.auth-terms-updated {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.auth-top-bar {
    margin-bottom: 16px;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.auth-back-link:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 768px) {
    .auth-page {
        padding: 32px 16px;
    }

    .auth-card {
        padding: 28px 24px;
        border-radius: 14px 0 14px 14px;
        clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
    }

    .auth-card-corner {
        width: 28px;
        height: 28px;
    }

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

    .auth-subtitle {
        font-size: 0.82rem;
        margin-bottom: 22px;
    }

    .auth-input {
        height: 46px;
        font-size: 0.88rem;
    }

    .auth-btn {
        height: 46px;
        font-size: 0.88rem;
    }

    .auth-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 480px) {
    .auth-page {
        padding: 20px 12px;
    }

    .auth-container,
    .auth-container-wide,
    .auth-container-terms {
        max-width: 100%;
        width: 92%;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: 12px 0 12px 12px;
        clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
    }

    .auth-card-corner {
        width: 22px;
        height: 22px;
    }

    .auth-logo {
        margin-bottom: 6px;
    }

    .auth-logo img {
        height: 30px;
    }

    .auth-brand {
        font-size: 1.3rem;
    }

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

    .auth-subtitle {
        font-size: 0.8rem;
        margin-bottom: 20px;
    }

    .auth-label {
        font-size: 0.78rem;
    }

    .auth-input {
        height: 44px;
        font-size: 0.85rem;
        padding-left: 38px;
    }

    .auth-input-icon {
        width: 16px;
        height: 16px;
        left: 12px;
    }

    .auth-btn {
        height: 44px;
        font-size: 0.85rem;
    }

    .auth-footer-text {
        font-size: 0.8rem;
    }

    .auth-footer-alt {
        font-size: 0.75rem;
    }

    .auth-check {
        font-size: 0.78rem;
    }

    .auth-alert {
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .auth-terms-heading {
        font-size: 0.95rem;
    }

    .auth-terms-list li {
        font-size: 0.82rem;
    }

    .auth-success-icon {
        width: 60px;
        height: 60px;
    }

    .auth-success-icon svg {
        width: 32px;
        height: 32px;
    }
}

/* ========================================
   OAuth Buttons
   ======================================== */
.oauth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
}
.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.oauth-divider span {
    font-size: 0.76rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px 0 10px 10px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}
.oauth-btn:hover {
    border-color: var(--text-secondary);
    background: var(--surface);
}
.oauth-btn svg { flex-shrink: 0; }
.oauth-btn-google:hover {
    border-color: #4285f4;
    background: color-mix(in srgb, #4285f4 5%, var(--card));
}
.oauth-btn-github:hover {
    border-color: var(--text);
    background: var(--surface);
}
