/* Shared styles for Digz auth pages: login, register, forgot-password, reset-password */
/* All color variables come from style/theme.css - these are local aliases. */
:root {
    --radius: 14px;
    --shadow: var(--shadow-2, 0 4px 12px rgba(0,0,0,0.25));
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
}
:root[data-theme="dark"] {
    --bg-dark: var(--bg-1);
    --bg-light: var(--bg-2);
    --card-bg: var(--surface);
    --glass: var(--surface-2);
    --accent-start: var(--accent);
    --accent-end: var(--accent-2);
    --highlight: var(--accent);
    --muted: var(--muted);
    --success: var(--good);
    --danger: var(--bad);
    --border: var(--border);
}
:root[data-theme="light"] {
    --bg-dark: var(--bg-1);
    --bg-light: var(--bg-2);
    --card-bg: var(--surface);
    --glass: var(--surface-2);
    --accent-start: var(--accent);
    --accent-end: var(--accent-2);
    --highlight: var(--accent);
    --muted: var(--muted);
    --success: var(--good);
    --danger: var(--bad);
    --border: var(--border);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 2rem 1rem;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-background-clip: text;
    background-color: var(--surface-2) !important;
    -webkit-text-fill-color: var(--text) !important;
    box-shadow: inset 0 0 0 1000px var(--surface-2) !important;
}

/* New restructured layout: centered single-column with perks rail below */
.auth-shell {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem;
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

.brand p.small { margin-top: 0.25rem; }

.highlight {
    color: var(--highlight);
    font-weight: 600;
}

.small {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.5;
}

.muted { color: var(--muted); }

label {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 500;
}

.input {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    background: var(--glass);
    border: 1px solid var(--border);
    font-size: 1rem;
    color: inherit;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.input:focus {
    border-color: var(--accent-start);
    box-shadow: 0 0 0 3px rgba(90,74,255,0.15);
}

.field { margin-bottom: 1.25rem; }

.field .pw-wrap { position: relative; }

.field .pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
}

.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0 1.25rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.checkbox input { accent-color: var(--accent-start); }

.btn {
    padding: 0.75rem 1.1rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-1);
    transition: background .15s ease, transform .12s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 90%, white); }

.btn.ghost {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: none;
}

.btn.ghost:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }

.btn.full { width: 100%; }

.btn-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.telegram-btn {
    background: linear-gradient(135deg, #0088cc, #00aaff);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,136,204,0.3);
    text-decoration: none;
    flex-shrink: 0;
    transition: transform .15s ease;
}

.telegram-btn:hover { transform: translateY(-2px) scale(1.05); }
.telegram-btn svg { width: 22px; height: 22px; }

.notice {
    font-size: 0.825rem;
    color: var(--muted);
    line-height: 1.5;
    margin-top: 0.5rem;
    text-align: center;
}

a.link {
    color: var(--highlight);
    text-decoration: none;
    transition: color .2s ease;
}
a.link:hover { color: #fff; text-decoration: underline; }

/* Messages */
.msg {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    animation: slideIn .3s ease;
}
.msg.error {
    background: rgba(248,113,113,0.1);
    color: #fee2e2;
    border: 1px solid rgba(248,113,113,0.25);
}
.msg.success {
    background: rgba(45,212,191,0.1);
    color: #ccfbf1;
    border: 1px solid rgba(45,212,191,0.25);
}

/* Perks rail - replaces the big info aside */
.perks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.625rem;
}
.perk {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--muted);
    transition: transform .15s ease, border-color .15s ease;
}
.perk:hover { transform: translateY(-2px); border-color: rgba(64,196,255,0.35); }
.perk .perk-icon { font-size: 1.1rem; margin-bottom: 0.35rem; }
.perk .perk-title { color: var(--highlight); font-weight: 600; display: block; margin-bottom: 0.2rem; font-size: 0.8rem; }

/* Optional bullet list for reset/forgot pages */
.bullets {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.bullets li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.bullets li::before {
    content: '✔';
    position: absolute;
    left: 0;
    color: var(--highlight);
}

footer.auth-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

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

@media (max-width: 600px) {
    .card { padding: 1.75rem; }
    .perks { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 1.3rem; }
}
