/* ==========================================================
   TALABUTAB NORTE NATIONAL HIGH SCHOOL (TNNHS)
   Sleek Modern WiFi Captive Portal Stylesheet
   ========================================================== */

:root {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --border-color: #e2e8f0;
    --border-highlight: #facc15;
    
    --primary: #facc15;
    --primary-hover: #eab308;
    --primary-glow: rgba(250, 204, 21, 0.45);
    
    --secondary: #eab308;
    --secondary-glow: rgba(234, 179, 8, 0.35);
    
    --teacher-color: #facc15;
    --teacher-glow: rgba(250, 204, 21, 0.45);
    
    --success: #10b981;
    --warning: #eab308;
    --danger: #ef4444;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --shadow-main: 0 20px 45px -10px rgba(15, 23, 42, 0.15), 0 4px 16px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #ffffff !important;
    background-image: none !important;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
}

.portal-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px; /* Cellphone CP viewport size */
    margin: 0 auto;
}

.portal-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.15), 0 4px 16px rgba(0, 0, 0, 0.06);
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #facc15, #eab308, #fbbf24);
    z-index: 10;
}

.card-top-banner {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.card-top-banner img {
    width: 100%;
    height: auto;
    display: block;
}

.portal-body {
    padding: 0 20px 24px 20px;
    background: #ffffff;
}

.portal-header {
    background: #ffffff;
    margin: 0 -20px 20px -20px;
    padding: 16px 20px 20px 20px;
    text-align: center;
    border-bottom: 3.5px solid #facc15;
}

.portal-header .school-title {
    color: #0f172a !important;
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: 6px;
}

.portal-header .portal-subtitle {
    color: #334155 !important;
    font-size: 0.84rem;
    font-weight: 600;
}

.school-logo-badge {
    width: 105px;
    height: 105px;
    margin: 0 auto 10px;
    position: relative;
    z-index: 5;
    background: #ffffff;
    border: 3.5px solid #facc15;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(250, 204, 21, 0.35);
    animation: pulseGlow 4s infinite alternate;
    overflow: hidden;
    padding: 4px;
}

.school-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 15px rgba(250, 204, 21, 0.3); transform: scale(1); }
    100% { box-shadow: 0 0 30px rgba(234, 179, 8, 0.6); transform: scale(1.03); }
}

.school-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #0f172a !important;
    margin-bottom: 4px;
}

.portal-subtitle {
    font-size: 0.84rem;
    color: #334155 !important;
    font-weight: 600;
}

.band-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 18px;
}

.band-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.band-pill.student {
    background: #fef08a;
    color: #854d0e;
    border: 1px solid #facc15;
}

.band-pill.teacher {
    background: #fde047;
    color: #713f12;
    border: 1px solid #eab308;
}

.band-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.announcement-box {
    background: #fefce8;
    border: 1.5px dashed #eab308;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 0.82rem;
    color: #1e293b !important;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.announcement-box svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    fill: #ca8a04;
    margin-top: 2px;
}

.portal-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 22px;
    border: 1px solid #cbd5e1;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #475569;
    padding: 12px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #854d0e;
}

.tab-btn.active,
.tab-btn.teacher-tab.active,
.tab-btn:active,
.tab-btn:focus {
    background: #facc15 !important;
    color: #0f172a !important;
    font-weight: 800;
    box-shadow: 0 4px 16px rgba(250, 204, 21, 0.45);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b !important;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    fill: #475569;
    pointer-events: none;
    transition: fill 0.2s;
}

.form-input,
.form-control,
input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    background: #ffffff !important;
    border: 2px solid #94a3b8 !important;
    border-radius: var(--radius-md);
    padding: 14px 14px 14px 44px;
    color: #0f172a !important;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.form-input:focus,
.form-control:focus,
input:focus,
select:focus {
    border-color: #eab308 !important;
    box-shadow: 0 0 0 3.5px rgba(250, 204, 21, 0.45) !important;
    background: #ffffff !important;
    color: #0f172a !important;
}

.form-input::placeholder,
input::placeholder {
    color: #64748b;
    font-weight: 500;
}

/* Fix Browser Autofill Dark Backgrounds */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a;
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    fill: #ca8a04;
}

.input-hint {
    font-size: 0.76rem;
    color: #475569 !important;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    outline: none;
}

.btn:active,
.btn:focus {
    background: #facc15 !important;
    color: #0f172a !important;
    border-color: #facc15 !important;
    box-shadow: 0 0 25px rgba(250, 204, 21, 0.6) !important;
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #facc15, #eab308);
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(250, 204, 21, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(250, 204, 21, 0.5);
    background: linear-gradient(135deg, #fde047, #facc15);
}

.btn-teacher {
    background: linear-gradient(135deg, #facc15, #eab308);
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(250, 204, 21, 0.35);
}

.btn-teacher:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(250, 204, 21, 0.5);
    background: linear-gradient(135deg, #fde047, #facc15);
}

.btn-claim {
    background: #fef08a;
    border: 1px solid #facc15;
    color: #854d0e;
    margin-top: 10px;
    font-weight: 700;
}

.btn-claim:hover {
    background: #facc15;
    border-color: #facc15;
    color: #0f172a;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.device-voucher-card {
    background: #fefce8;
    border: 1.5px solid #fde047;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(250, 204, 21, 0.15);
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.device-tag {
    font-size: 0.78rem;
    font-weight: 800;
    color: #854d0e;
    letter-spacing: 0.5px;
}

.badge-pill {
    background: #fef08a;
    color: #713f12 !important;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #facc15;
}

.faculty-banner {
    background: #fefce8;
    border: 1.5px solid #fde047;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 18px;
    text-align: left;
}

.faculty-badge {
    font-size: 0.74rem;
    font-weight: 800;
    color: #854d0e;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.faculty-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a !important;
    margin-bottom: 4px;
}

.faculty-desc {
    font-size: 0.82rem;
    color: #334155 !important;
    font-weight: 500;
    line-height: 1.4;
}

.status-connected-header {
    text-align: center;
    padding: 10px 0 22px;
}

.pulse-ring-container {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto 16px;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    animation: pingCircle 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pulse-core {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
}

.pulse-core svg {
    width: 42px;
    height: 42px;
    fill: #ffffff;
}

@keyframes pingCircle {
    75%, 100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.status-badge-active {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.countdown-box {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 20px;
    text-align: center;
}

.countdown-label {
    font-size: 0.8rem;
    color: #334155 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 700;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.timer-segment {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    min-width: 65px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timer-val {
    font-size: 1.7rem;
    font-weight: 800;
    color: #0f172a !important;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.timer-unit {
    font-size: 0.68rem;
    color: #475569 !important;
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 700;
}

.info-list {
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1.5px solid #cbd5e1;
    margin-bottom: 22px;
    overflow: hidden;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.88rem;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #475569 !important;
    font-weight: 600;
}

.info-val {
    color: #0f172a !important;
    font-weight: 800;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert-warning {
    background: #fefce8;
    border: 1px solid #fde047;
    color: #854d0e;
}

.portal-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.78rem;
    color: #64748b !important;
    font-weight: 500;
}

.portal-footer p,
.portal-footer a {
    color: #334155 !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.portal-footer a:hover {
    color: #ca8a04 !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    padding: 28px 24px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    transform: scale(0.92);
    transition: transform 0.25s ease;
    color: #0f172a !important;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.code-display-box {
    background: #fefce8;
    border: 1.5px dashed #eab308;
    border-radius: var(--radius-md);
    padding: 16px 12px;
    margin: 16px 0;
}

.code-display-box .voucher-text {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #854d0e;
    font-family: monospace;
    user-select: all;
}

.btn-copy-code {
    background: #facc15;
    color: #0f172a !important;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(250, 204, 21, 0.4);
}

.btn-copy-code:hover {
    background: #eab308;
    transform: scale(1.02);
}

.device-meta-note {
    font-size: 0.74rem;
    color: #475569 !important;
    font-weight: 500;
    line-height: 1.4;
}

.btn-connect-device {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, #facc15, #eab308);
    color: #0f172a !important;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-connect-device:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(250, 204, 21, 0.5);
    background: linear-gradient(135deg, #fde047, #facc15);
}

.duration-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.duration-chips .chip {
    background: #fef08a;
    border: 1px solid #facc15;
    color: #713f12 !important;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.duration-chips .chip:hover {
    background: #facc15;
    color: #0f172a !important;
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .portal-card {
        padding: 24px 18px;
    }
    
    .timer-segment {
        min-width: 52px;
        padding: 8px 10px;
    }
    
    .timer-val {
        font-size: 1.4rem;
    }
}
