/* ============================================================
   auth.css — estilos para login y dashboard
   ============================================================ */

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

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #0e0e0e;
    color: #7C6C5C;
    min-height: 100vh;
}

/* ── LOGIN ─────────────────────────────────────────────────── */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: #1A1A1A;
    border-radius: 20px;
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.05);
}

.login-card h1 {
    color: #c8b89a;
    font-size: 2.2rem;
    margin: 0 0 0.4rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.login-card .subtitle {
    font-size: 0.88rem;
    margin: 0 0 2.5rem;
    opacity: 0.5;
    letter-spacing: 0.2px;
}

/* ── Botón Google ──────────────────────────────────────────── */

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 15px 20px;
    background: #ffffff;
    color: #1f1f1f;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.3),
        0 4px 16px rgba(0,0,0,0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.15s;
    position: relative;
}

.btn-google:hover {
    background: #f8f8f8;
    transform: translateY(-3px);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.2),
        0 10px 28px rgba(0,0,0,0.45);
}

.btn-google:active {
    transform: translateY(1px);
    box-shadow:
        0 1px 2px rgba(0,0,0,0.25),
        0 2px 8px rgba(0,0,0,0.25);
    transition-duration: 0.05s;
}

.btn-google:disabled {
    cursor: default;
    opacity: 0.75;
    transform: none;
}

.btn-google .g-icon { flex-shrink: 0; }

/* Spinner que reemplaza al logo durante el carga */
.btn-google .btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(0,0,0,0.12);
    border-top-color: #4285F4;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.btn-google.is-loading .g-icon    { display: none; }
.btn-google.is-loading .btn-spinner { display: block; }

.login-disclaimer {
    font-size: 0.75rem;
    opacity: 0.35;
    margin-top: 1.5rem;
    letter-spacing: 0.2px;
}

/* ── DASHBOARD ──────────────────────────────────────────────── */

.dash-topbar {
    background: #1A1A1A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid rgba(124,108,92,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dash-topbar .app-name {
    color: #c8b89a;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
}

.dash-topbar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-topbar .user-name { font-size: 0.85rem; }

.btn-logout {
    background: none;
    border: 1px solid rgba(124,108,92,0.35);
    color: #7C6C5C;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}
.btn-logout:hover { border-color: #7C6C5C; color: #c8b89a; }

.dash-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.dash-header h2 {
    color: #c8b89a;
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.btn-new {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.1s;
}
.btn-new:hover { background: #22963d; }
.btn-new:active { transform: scale(0.97); }

/* Grilla de tarjetas */
.restaurants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}

.rest-card {
    background: #1A1A1A;
    border: 1px solid rgba(124,108,92,0.15);
    border-radius: 12px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.15s;
}
.rest-card:hover { border-color: rgba(124,108,92,0.4); }

.card-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rest-card h3, .rest-name {
    color: #c8b89a;
    margin: 0;
    font-size: 1rem;
}

.btn-rename {
    background: none;
    border: none;
    color: rgba(124,108,92,0.3);
    cursor: pointer;
    padding: 3px 4px;
    line-height: 1;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}
.btn-rename:hover { color: #c8b89a; background: rgba(124,108,92,0.1); }

.rename-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(200,184,154,0.5);
    color: #c8b89a;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    outline: none;
    min-width: 0;
    flex: 1;
    padding: 1px 0;
}

.rest-card .card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-card {
    flex: 1;
    min-width: 80px;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid rgba(124,108,92,0.3);
    background: none;
    color: #7C6C5C;
    cursor: pointer;
    font-size: 0.8rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.15s;
    display: inline-block;
}
.btn-card:hover { border-color: #7C6C5C; color: #c8b89a; }
.btn-card.btn-edit { background: rgba(40,167,69,0.1); border-color: rgba(40,167,69,0.4); color: #5cb85c; }
.btn-card.btn-edit:hover { background: rgba(40,167,69,0.2); }
.btn-card.btn-delete { border-color: rgba(220,53,69,0.3); color: #dc3545; }
.btn-card.btn-delete:hover { background: rgba(220,53,69,0.1); }

.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 4rem 2rem;
    opacity: 0.4;
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ── MODAL (crear restaurante + QR) ─────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.visible { opacity: 1; pointer-events: auto; }

.modal-box {
    background: #1A1A1A;
    border-radius: 14px;
    padding: 2rem;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
}

.modal-box h3 {
    color: #c8b89a;
    margin: 0 0 1.2rem;
    font-size: 1rem;
}

.modal-box input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: #111;
    border: 1px solid rgba(124,108,92,0.35);
    border-radius: 8px;
    color: #c8b89a;
    font-size: 1rem;
    outline: none;
    margin-bottom: 1rem;
}
.modal-box input:focus { border-color: #7C6C5C; }

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

.btn-cancel {
    padding: 8px 16px;
    background: none;
    border: 1px solid rgba(124,108,92,0.3);
    color: #7C6C5C;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-confirm {
    padding: 8px 18px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

/* QR modal */
.qr-content { text-align: center; }
.qr-content img { border-radius: 8px; margin: 1rem 0; }

.qr-url-row {
    display: flex;
    gap: 8px;
    margin-top: 0.5rem;
}

.qr-url-row input {
    flex: 1;
    padding: 8px 10px;
    background: #111;
    border: 1px solid rgba(124,108,92,0.3);
    border-radius: 6px;
    color: #7C6C5C;
    font-size: 0.8rem;
    outline: none;
}

.btn-copy {
    padding: 8px 14px;
    background: rgba(124,108,92,0.15);
    border: 1px solid rgba(124,108,92,0.3);
    color: #7C6C5C;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.15s;
}
.btn-copy:hover { background: rgba(124,108,92,0.25); }
.btn-copy.copied { color: #5cb85c; border-color: rgba(40,167,69,0.4); }

/* ── THEME TOGGLE BUTTON ────────────────────────────────────── */
.theme-btn {
    background: none;
    border: 1px solid rgba(124,108,92,0.3);
    color: #7C6C5C;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
    line-height: 1;
}
.theme-btn:hover { border-color: #7C6C5C; color: #c8b89a; }

/* ── LIGHT MODE ─────────────────────────────────────────────── */
body.light {
    background-color: #f2ede6;
    color: #3a2e22;
}
body.light .login-card {
    background: #fff;
    border-color: rgba(100,80,50,.1);
    box-shadow: 0 8px 40px rgba(100,80,50,.12);
}
body.light .login-card h1 { color: #6b5135; }
body.light .login-card .subtitle { color: rgba(60,42,20,.5); }
body.light .login-disclaimer { color: rgba(60,42,20,.4); }

body.light .dash-topbar {
    background: #ede6dc;
    border-bottom-color: rgba(100,80,50,.15);
}
body.light .dash-topbar .app-name { color: #6b5135; }
body.light .dash-topbar .user-name { color: rgba(60,42,20,.6); }
body.light .btn-logout { color: #7a6248; border-color: rgba(100,80,50,.3); }
body.light .btn-logout:hover { color: #6b5135; border-color: #7a6248; }
body.light .theme-btn { color: #7a6248; border-color: rgba(100,80,50,.3); }
body.light .theme-btn:hover { color: #6b5135; border-color: #7a6248; }
body.light #superAdminLink { color: #7a6248; border-color: rgba(100,80,50,.3); }

body.light .dash-main { }
body.light .dash-header h2 { color: #6b5135; }
body.light .rest-card {
    background: #fff;
    border-color: rgba(100,80,50,.15);
}
body.light .rest-card:hover { border-color: rgba(100,80,50,.35); }
body.light .rest-card h3, body.light .rest-name { color: #6b5135; }
body.light .btn-card { color: #7a6248; border-color: rgba(100,80,50,.25); }
body.light .btn-card:hover { color: #6b5135; border-color: #7a6248; }
body.light .btn-rename { color: rgba(100,80,50,.3); }
body.light .btn-rename:hover { color: #6b5135; background: rgba(100,80,50,.08); }
body.light .rename-input { color: #6b5135; border-bottom-color: rgba(100,80,50,.4); }
body.light .empty-state { color: rgba(60,42,20,.4); }

body.light .modal-overlay { background: rgba(60,42,20,.4); }
body.light .modal-box {
    background: #fff;
    box-shadow: 0 12px 40px rgba(60,42,20,.15);
}
body.light .modal-box h3 { color: #6b5135; }
body.light .modal-box input[type="text"] {
    background: #f5f0ea;
    border-color: rgba(100,80,50,.3);
    color: #3a2e22;
}
body.light .btn-cancel { color: #7a6248; border-color: rgba(100,80,50,.3); }
body.light .qr-url-row input {
    background: #f5f0ea;
    border-color: rgba(100,80,50,.25);
    color: #7a6248;
}
body.light .btn-copy {
    background: rgba(100,80,50,.08);
    border-color: rgba(100,80,50,.25);
    color: #7a6248;
}
