:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --font-heading: 'Noto Serif TC', 'Microsoft JhengHei', serif;
    --font-body: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

.container {
    max-width: 1200px;
    width: 90%;
    text-align: center;
    padding: 40px 0 120px 0;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 3rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--primary-glow);
}

.icon-box {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.qr-placeholder {
    width: 180px;
    height: 180px;
    background: white;
    padding: 10px;
    border-radius: 12px;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.qr-placeholder:hover {
    transform: scale(1.05);
}

.info-text {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn {
    padding: 0.8rem 2rem;
    font-family: inherit;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    margin-top: auto;
}

.btn-primary:hover {
    background: #4f46e5;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 0.5rem;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.show {
    display: flex;
}

.modal-content {
    background: #1e293b;
    padding: 3rem;
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.modal-header-row h3 { margin: 0; }
.modal-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close-btn:hover { color: #f8fafc; background: rgba(255,255,255,0.1); }
.modal-close-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
}

input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    box-sizing: border-box;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.footer {
    margin-top: 4rem;
    color: #64748b;
    font-size: 0.85rem;
}

/* Card-specific icon-box variants */
.icon-box--store {
    background: linear-gradient(135deg, #10b981, #3b82f6);
}

.icon-box--kiosk {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

/* Card-specific button variants */
.btn--store {
    background: #10b981;
}

.btn--store:hover {
    background: #059669;
}

.btn--kiosk {
    background: #f59e0b;
    margin-top: 0;
}

.btn--kiosk:hover {
    background: #d97706;
}

.btn--activate {
    background: #f59e0b;
    margin-top: 1rem;
}

.btn--activate:hover {
    background: #d97706;
}

.btn--enter {
    background: #10b981;
    margin-top: 1rem;
}

.btn--enter:hover {
    background: #059669;
}

/* Kiosk rocket icon */
.kiosk-launch-icon {
    margin: 2rem 0;
    font-size: 3rem;
    color: #f59e0b;
}

/* Small info text (subtitle under kiosk section) */
.info-text--small {
    font-size: 0.8rem;
    margin: 0 0 0.5rem;
    text-align: center;
    margin-top: auto;
}

/* Modal heading/description defaults */
.modal-content h3 {
    margin-top: 0;
}

.modal-description {
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Branch code uppercase */
#branchCode {
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
}
