/* ==========================================================================
   Jinrui Ramen (jinruiramen.com) - Membership Portal Design System
   Brand Palette:
   - Jinrui Red: #d51517
   - Jinrui Orange: #eb9b43
   - Charcoal Black: #111111 / #000000
   - Off-White Cream: #FAF8F5 / #FFFFFF
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #d51517;
    --primary-hover: #b80f11;
    --secondary: #eb9b43;
    --secondary-light: #fef5ea;
    --dark: #111111;
    --dark-surface: #1e1e1e;
    --light-bg: #FAF8F5;
    --card-bg: #ffffff;
    --text-primary: #1c1917;
    --text-muted: #78716c;
    --border-color: #e7e5e4;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 36px rgba(213,21,23,0.12);
}

/* Reset & Mobile Viewport Defaults */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Header & Brand Navbar */
.site-header {
    background: var(--dark);
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo-img {
    height: 42px;
    width: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.brand-title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.brand-title span {
    color: var(--secondary);
}

/* Navigation Links */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    list-style: none;
}

.nav-link {
    color: #e5e5e5;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background: rgba(213, 21, 23, 0.2);
}

.nav-link.btn-nav {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(213,21,23,0.4);
}

.nav-link.btn-nav:hover {
    background: var(--primary-hover);
}

/* Layout Containers */
.main-wrapper {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 80px 20px;
}

.auth-container {
    max-width: 460px;
    margin: 30px auto;
}

/* Cards & Panels */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.35rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--dark);
}

.form-label .required {
    color: var(--primary);
    margin-left: 2px;
}

.form-control, .form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: var(--dark);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(213, 21, 23, 0.12);
}

.phone-group {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(213, 21, 23, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(213, 21, 23, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(235, 155, 67, 0.3);
}

.btn-secondary:hover {
    background: #d88934;
}

.btn-dark {
    background: var(--dark);
    color: #ffffff;
}

.btn-dark:hover {
    background: #262626;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Membership Card Widget */
.membership-card {
    background: linear-gradient(135deg, #111111 0%, #2a0809 50%, #d51517 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.membership-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(235,155,67,0.25) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-brand img {
    height: 36px;
    border-radius: 4px;
}

.card-brand span {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.card-status-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-status-badge.active {
    background: rgba(22, 163, 74, 0.3);
    color: #86efac;
    border: 1px solid rgba(134, 239, 172, 0.4);
}

.card-number {
    font-family: monospace, monospace;
    font-size: 1.5rem;
    letter-spacing: 3px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.card-holder {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.holder-name {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.holder-joined {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* QR Code Section */
.qr-container {
    text-align: center;
    background: #ffffff;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: inline-block;
    margin: 0 auto;
}

.qr-box {
    margin: 10px auto;
    padding: 10px;
    background: #ffffff;
    border: 2px dashed var(--secondary);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-info {
    background: #e0f2fe;
    color: #0369a1;
}

/* Alerts / Flash Messages */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

/* Voucher Cards Grid */
.voucher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.voucher-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.voucher-badge-signup {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(213,21,23,0.4);
    z-index: 2;
}

.voucher-img {
    height: 140px;
    width: 100%;
    object-fit: cover;
    background: var(--dark);
}

.voucher-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.voucher-title {
    font-size: 1.15rem;
    margin-bottom: 6px;
    color: var(--dark);
}

.voucher-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    flex: 1;
}

.voucher-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
}

/* Mobile Bottom Navigation Bar */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark);
    border-top: 2px solid var(--primary);
    padding: 8px 16px env(safe-area-inset-bottom, 8px) 16px;
    z-index: 999;
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    .desktop-nav {
        display: none;
    }

    .main-wrapper {
        padding-bottom: 90px;
    }
}

.mobile-nav-item {
    color: #a3a3a3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--secondary);
}

.mobile-nav-icon {
    font-size: 1.25rem;
}

/* Admin Dashboard Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.95rem;
}

.admin-table th, .admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--light-bg);
    color: var(--dark);
    font-weight: 700;
}

.admin-table tr:hover {
    background: #fafaf9;
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: #a3a3a3;
    text-align: center;
    padding: 24px 20px;
    font-size: 0.85rem;
    border-top: 1px solid #262626;
    margin-top: auto;
}

.site-footer a {
    color: var(--secondary);
}
