/* ═══════════════════════════════════════════════════════
   IPTV Customer Portal Styles
   Design: dark theme, clean & modern
   ═══════════════════════════════════════════════════════ */

:root {
    --bg: #0f1117;
    --bg-card: #161822;
    --bg-hover: #1c1f2e;
    --border: #252838;
    --text: #e0e0e6;
    --text-dim: #9ca3b4;
    --text-muted: #6b7280;
    --primary: #4f8aff;
    --primary-hover: #3d78f0;
    --green: #4ade80;
    --yellow: #f0b429;
    --red: #f87171;
    --radius: 10px;
    --radius-sm: 6px;
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ─── Auth Pages (Login/Register) ──────────────────── */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(79,138,255,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(74,222,128,0.05) 0%, transparent 50%),
        var(--bg);
}

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

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), #6c5ce7);
    border-radius: 14px;
    color: #fff;
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ─── Alerts ───────────────────────────────────────── */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: rgba(248,113,113,0.12);
    color: var(--red);
    border: 1px solid rgba(248,113,113,0.2);
}

.alert-success {
    background: rgba(74,222,128,0.12);
    color: var(--green);
    border: 1px solid rgba(74,222,128,0.2);
}

/* ─── Form Elements ────────────────────────────────── */

.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,138,255,0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 2.75rem;
}

.toggle-pw {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
}

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

.form-row {
    margin-bottom: 1.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* ─── Buttons ──────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 0.7rem 1.25rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,138,255,0.3);
}

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

.btn-full {
    width: 100%;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
}

.btn-outline:hover {
    border-color: var(--text-dim);
    color: var(--text);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ─── Auth Footer ──────────────────────────────────── */

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
}

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

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

/* ─── Dashboard Layout ─────────────────────────────── */

.dash-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.dash-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.brand svg { color: var(--primary); }

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.dash-main {
    min-height: calc(100vh - 120px);
}

.dash-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

.dash-welcome {
    margin-bottom: 1.5rem;
}

.dash-welcome h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.dash-welcome p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ─── IPTV Line Cards ──────────────────────────────── */

.lines-grid {
    display: grid;
    gap: 0.75rem;
}

.line-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color 0.15s;
}

.line-card:hover {
    border-color: rgba(79,138,255,0.3);
}

.line-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.line-label {
    font-weight: 600;
    font-size: 1rem;
}

.line-username {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-top: 0.15rem;
}

.line-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.line-price span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.line-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.status-good {
    background: rgba(74,222,128,0.1);
    color: var(--green);
}

.status-warning {
    background: rgba(240,180,41,0.1);
    color: var(--yellow);
}

.status-urgent {
    background: rgba(248,113,113,0.1);
    color: var(--red);
}

.status-expired {
    background: rgba(248,113,113,0.15);
    color: var(--red);
}

/* ─── Renew Form ───────────────────────────────────── */

.line-actions {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.renew-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.months-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.months-select label {
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.months-select select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.months-select select:focus {
    border-color: var(--primary);
}

.btn-renew {
    white-space: nowrap;
}

/* ─── Empty State ──────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-state h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.empty-state p {
    color: var(--text-dim);
    font-size: 0.9rem;
    max-width: 380px;
    margin: 0 auto;
}

/* ─── Footer ───────────────────────────────────────── */

.dash-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.dash-footer a {
    color: var(--text-dim);
    text-decoration: none;
}

.dash-footer a:hover {
    color: var(--primary);
}

/* ─── Responsive ───────────────────────────────────── */

@media (max-width: 480px) {
    .auth-card { padding: 1.5rem; }
    .line-card-top { flex-direction: column; gap: 0.5rem; }
    .renew-form { flex-direction: column; align-items: stretch; }
    .btn-renew { width: 100%; }
    .dash-header-inner { padding: 0.65rem 1rem; }
    .user-name { display: none; }
}
