/* ZES Wi-Fi Portal — light, classy, responsive theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
    min-height: 100vh;
    background: #f4f7fb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
}

body.portal-body { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }

.portal-wrap { width: 100%; max-width: 560px; margin: 0 auto; }

.portal-wrap-wide { max-width: 760px; }

.portal-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin-bottom: 14px;
    text-align: center;
}

.portal-nav-wrap { margin-bottom: 14px; }

.portal-menu-toggle {
    display: none;
    width: 100%;
    height: 42px;
    border: 1px solid #d5deea;
    background: #fff;
    color: #1e293b;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.portal-nav a {
    color: #5b6471;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.portal-nav a:hover,
.portal-nav a.active { color: #0f172a; font-weight: 700; }

.portal-nav .sep { color: #c2c9d3; }

.portal-card {
    background: #ffffff;
    border: 1px solid #e5eaf1;
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
    width: 100%;
}

.portal-header { text-align: center; margin-bottom: 20px; }

.logo-circle {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #edf3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.portal-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.portal-subtitle {
    font-size: 13px;
    color: #64748b;
}

.text-muted { color: #6b7280; }
.text-center { text-align: center; }
.text-small { font-size: 12px; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.alert {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.45;
}

.alert-danger { background: rgba(220, 53, 69, 0.25); border: 1px solid rgba(220, 53, 69, 0.5); }
.alert-warning { background: #fff7e6; border: 1px solid #ffd38a; color: #9a6700; }
.alert-success { background: #ebfff2; border: 1px solid #a8e3bd; color: #0f5132; }
.alert-secondary { background: #f8fafc; border: 1px solid #dbe3ee; color: #334155; }
.alert-info { background: #eaf7ff; border: 1px solid #9dd6f2; color: #0c4a6e; }
.alert-danger { background: #ffeef0; border: 1px solid #f5b9c0; color: #842029; }

.alert code {
    background: #eef2f7;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.form-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.form-control {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d5dce6;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    font-size: 14px;
    outline: none;
}

.form-control:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16); }

.form-control::placeholder { color: #9ca3af; }

.package-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }

.package-option {
    display: block;
    background: #fbfdff;
    border: 1px solid #dbe5f0;
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.package-option:hover,
.package-option.selected {
    border-color: #2563eb;
    background: #f5f9ff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.16);
    transform: translateY(-1px);
}

.package-option input { display: none; }

.package-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.package-price {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
    color: #0f172a;
}

.package-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.package-chip {
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #cfe0ff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    line-height: 1.2;
}

.btn {
    display: inline-block;
    width: 100%;
    height: 48px;
    line-height: 48px;
    padding: 0 20px;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary, .btn-wifi { background: #2563eb; color: #fff; }

.btn-primary:hover:not(:disabled),
.btn-wifi:hover:not(:disabled) { background: #1d4ed8; }

.btn-activate {
    background: #00c853;
    color: #fff;
}

.btn-activate:hover { background: #00a844; }

.btn-outline {
    background: transparent;
    color: #334155;
    border: 1px solid #cbd5e1;
    line-height: 46px;
}

.btn-outline:hover { background: #f8fafc; }

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-row .btn { flex: 1; min-width: 140px; }

.voucher-box {
    background: #f8fffb;
    border: 2px dashed #22c55e;
    border-radius: 14px;
    padding: 18px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    word-break: break-all;
    user-select: all;
    cursor: pointer;
    margin-bottom: 12px;
    color: #14532d;
}

.voucher-list { display: flex; flex-direction: column; gap: 14px; }

.voucher-item {
    background: #fbfdff;
    border: 1px solid #dde6f1;
    border-radius: 14px;
    padding: 16px;
}

.voucher-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #198754;
    color: #fff;
    margin-bottom: 8px;
}

.portal-footer {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border: 3px solid #dbe7ff;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.link-muted {
    color: #64748b;
    font-size: 13px;
    text-decoration: none;
}

.link-muted:hover { color: #0f172a; text-decoration: underline; }

@media (min-width: 768px) {
    .package-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
    .portal-menu-toggle { display: block; }
    .portal-nav {
        display: none;
        flex-direction: column;
        gap: 8px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 10px;
    }
    .portal-nav.open { display: flex; }
    .portal-nav .sep { display: none; }
    .portal-card { padding: 22px 16px; }
    .package-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .package-price { font-size: 18px; }
}
