/* =====================================================
 * TAPMERCHANT — AUTH PAGES STYLES
 * File: css/auth.css
 * Used by: login.html, signup.html, admin/index.html
 * ===================================================== */

/* -----------------------------------------------------
 * BODY & LAYOUT
 * ----------------------------------------------------- */
.tm-auth-body {
    min-height: 100vh;
    background: var(--tm-bg);
    overflow-x: hidden;
}

.tm-auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* -----------------------------------------------------
 * LEFT SIDE — VISUAL PANEL
 * ----------------------------------------------------- */
.tm-auth-aside {
    position: relative;
    background: var(--tm-brand-gradient-hero);
    color: #fff;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

.tm-auth-aside-inner {
    position: relative;
    z-index: 2;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
}

.tm-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.tm-auth-logo:hover { color: #fff; }

.tm-auth-logo-mark {
    width: 34px;
    height: 34px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 4px;
}

.tm-auth-logo-mark svg { width: 100%; height: 100%; }

.tm-auth-logo-text { color: #fff; font-weight: 800; }

/* Content area (title + list) */
.tm-auth-aside-content {
    margin-top: 60px;
    max-width: 460px;
}

.tm-auth-aside-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 16px;
}

.tm-auth-aside-dot {
    color: #FBBF24;
}

.tm-auth-aside-sub {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.55;
    margin-bottom: 40px;
}

.tm-auth-aside-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tm-auth-aside-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.tm-auth-aside-check {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    color: #FBBF24;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.tm-auth-aside-footer {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

/* Decorative blobs on the aside */
.tm-auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

.tm-auth-blob-1 {
    width: 400px;
    height: 400px;
    background: #FBBF24;
    top: -80px;
    right: -100px;
    animation: tm-auth-blob 22s ease-in-out infinite;
}

.tm-auth-blob-2 {
    width: 320px;
    height: 320px;
    background: #14B87F;
    bottom: -80px;
    left: -80px;
    animation: tm-auth-blob 26s ease-in-out infinite reverse;
}

@keyframes tm-auth-blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -30px) scale(1.1); }
    66%      { transform: translate(-30px, 20px) scale(0.95); }
}

/* -----------------------------------------------------
 * RIGHT SIDE — FORM
 * ----------------------------------------------------- */
.tm-auth-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    background: var(--tm-bg);
}

.tm-auth-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
}

.tm-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tm-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all var(--tm-transition-fast);
}

.tm-auth-back:hover {
    background: var(--tm-bg-muted);
    color: var(--tm-text);
}

/* Form container centred on the page */
.tm-auth-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 32px 60px;
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
}

.tm-auth-form-head {
    margin-bottom: 32px;
    text-align: left;
}

.tm-auth-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--tm-text);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.tm-auth-sub {
    color: var(--tm-text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

/* Form */
.tm-auth-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tm-auth-form .tm-form-group {
    margin-bottom: 20px;
}

/* Label row (label + right link like "Forgot?") */
.tm-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tm-label-row .tm-label {
    margin-bottom: 0;
}

/* Password input wrapper with toggle */
.tm-input-wrap {
    position: relative;
}

.tm-input-wrap .tm-input {
    padding-right: 48px;
}

.tm-input-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--tm-text-subtle);
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tm-transition-fast);
}

.tm-input-toggle:hover {
    background: var(--tm-bg-muted);
    color: var(--tm-text);
}

/* Checkbox row */
.tm-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: var(--tm-text);
    font-size: 0.9375rem;
    margin-bottom: 24px;
    padding: 4px 0;
}

.tm-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--tm-brand-primary);
    cursor: pointer;
    margin: 0;
}

/* Submit button — includes spinner */
.tm-auth-form .tm-btn {
    justify-content: center;
    gap: 10px;
}

.tm-auth-form .tm-spinner {
    width: 18px;
    height: 18px;
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

/* Auth link */
.tm-auth-link {
    color: var(--tm-brand-primary);
    font-weight: 600;
    text-decoration: none;
}

.tm-auth-link:hover {
    color: var(--tm-brand-primary-hover);
    text-decoration: underline;
}

.tm-auth-link-sm {
    color: var(--tm-brand-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.8125rem;
}

.tm-auth-link-sm:hover {
    color: var(--tm-brand-primary-hover);
    text-decoration: underline;
}

/* Divider (— or —) */
.tm-auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--tm-text-subtle);
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 24px 0;
}

.tm-auth-divider::before,
.tm-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--tm-border);
}

.tm-auth-divider span {
    padding: 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Footer text */
.tm-auth-footer-text {
    text-align: center;
    color: var(--tm-text-muted);
    font-size: 0.9375rem;
    margin-top: 8px;
}

.tm-auth-admin-hint {
    text-align: center;
    color: var(--tm-text-subtle);
    font-size: 0.8125rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--tm-border);
}

/* -----------------------------------------------------
 * ALERT MESSAGES
 * ----------------------------------------------------- */
.tm-alert {
    padding: 14px 16px;
    border-radius: var(--tm-radius);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 20px;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: tm-alert-in 200ms ease-out;
}

.tm-alert-info {
    background: var(--tm-info-bg);
    color: var(--tm-info);
    border-color: var(--tm-info);
}

.tm-alert-success {
    background: var(--tm-success-bg);
    color: var(--tm-success);
    border-color: var(--tm-success);
}

.tm-alert-warning {
    background: var(--tm-warning-bg);
    color: var(--tm-warning);
    border-color: var(--tm-warning);
}

.tm-alert-error {
    background: var(--tm-danger-bg);
    color: var(--tm-danger);
    border-color: var(--tm-danger);
}

@keyframes tm-alert-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -----------------------------------------------------
 * PASSWORD STRENGTH METER (used on signup)
 * ----------------------------------------------------- */
.tm-pw-strength {
    margin-top: 10px;
}

.tm-pw-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}

.tm-pw-bar {
    height: 4px;
    background: var(--tm-border);
    border-radius: 2px;
    transition: background var(--tm-transition-fast);
}

.tm-pw-bar.is-weak     { background: var(--tm-danger); }
.tm-pw-bar.is-fair     { background: var(--tm-warning); }
.tm-pw-bar.is-good     { background: #3B82F6; }
.tm-pw-bar.is-strong   { background: var(--tm-success); }

.tm-pw-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tm-text-muted);
}

.tm-pw-label.is-weak     { color: var(--tm-danger); }
.tm-pw-label.is-fair     { color: var(--tm-warning); }
.tm-pw-label.is-good     { color: #3B82F6; }
.tm-pw-label.is-strong   { color: var(--tm-success); }

/* -----------------------------------------------------
 * INLINE HINTS / HELPERS
 * ----------------------------------------------------- */
.tm-auth-form .tm-help-text {
    margin-top: 8px;
    color: var(--tm-text-subtle);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* -----------------------------------------------------
 * RESPONSIVE — stack on small screens
 * ----------------------------------------------------- */
@media (max-width: 960px) {
    .tm-auth-shell {
        grid-template-columns: 1fr;
    }

    .tm-auth-aside {
        min-height: 260px;
        max-height: 320px;
    }

    .tm-auth-aside-inner {
        padding: 32px 32px 24px;
    }

    .tm-auth-aside-content {
        margin-top: 24px;
        max-width: 100%;
    }

    .tm-auth-aside-title {
        font-size: 1.75rem;
        margin-bottom: 8px;
    }

    .tm-auth-aside-sub {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .tm-auth-aside-list {
        display: none;
    }

    .tm-auth-aside-footer {
        display: none;
    }

    .tm-auth-main {
        min-height: auto;
    }

    .tm-auth-form-wrap {
        padding: 32px 24px 60px;
    }
}

@media (max-width: 480px) {
    .tm-auth-aside {
        min-height: 200px;
        max-height: 240px;
    }

    .tm-auth-aside-inner {
        padding: 24px 20px 16px;
    }

    .tm-auth-topbar {
        padding: 16px 20px;
    }

    .tm-auth-form-wrap {
        padding: 24px 20px 48px;
    }

    .tm-auth-aside-title {
        font-size: 1.5rem;
    }

    .tm-auth-aside-sub {
        font-size: 0.9375rem;
        margin-bottom: 0;
    }
}

/* =====================================================
 * END OF auth.css
 * ===================================================== */