@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.attendance-page {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #020617);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.attendance-shell {
    width: 100%;
    max-width: 420px;
    padding: 24px 16px;
}

.attendance-panel {
    background: var(--card-bg, rgba(30, 41, 59, 0.5));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 16px);
    padding: 32px 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.attendance-panel h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary, #f8fafc);
}

.attendance-panel p.att-sub {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.att-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 8px);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary, #f8fafc);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.att-input:focus {
    border-color: var(--accent, #3b82f6);
}

.att-input::placeholder {
    color: var(--text-secondary, #94a3b8);
    opacity: 0.7;
}

.att-results {
    list-style: none;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.att-results li {
    padding: 10px 14px;
    cursor: pointer;
    border-radius: var(--radius-sm, 8px);
    transition: background 0.15s;
    color: var(--text-primary, #f8fafc);
    font-size: 0.9rem;
}

.att-results li:hover {
    background: rgba(59, 130, 246, 0.15);
}

.att-btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm, 8px);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    margin-top: 12px;
}

.att-btn-primary {
    background: var(--accent, #3b82f6);
    color: #fff;
}

.att-btn-primary:hover {
    background: var(--accent-hover, #2563eb);
}

.att-btn-success {
    background: var(--success, #10b981);
    color: #fff;
}

.att-btn-success:hover {
    opacity: 0.9;
}

.att-btn-danger {
    background: var(--danger, #ef4444);
    color: #fff;
}

.att-btn-danger:hover {
    opacity: 0.9;
}

.att-btn-secondary {
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.att-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.att-error {
    color: var(--danger, #ef4444);
    font-size: 0.82rem;
    margin-top: 8px;
}

.att-status-card {
    text-align: center;
}

.att-status-card .att-user-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.att-status-card .att-state-label {
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 16px;
}

.att-back-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.82rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    text-decoration: underline;
    padding: 0;
}

.att-back-link:hover {
    color: var(--text-primary, #f8fafc);
}

.att-link-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
}

.att-link-group .att-back-link {
    margin-top: 0;
}

.att-pin-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 16px 0 8px;
}

.att-pin-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.15s;
}

.att-pin-dots span.filled {
    background: var(--accent, #3b82f6);
}

.att-setup-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}

/* Avatar Initials */
.att-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.att-avatar {
    width: 32px;
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Numpad */
.att-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}
.att-numpad-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary, #f8fafc);
    font-size: 1.25rem;
    padding: 16px 0;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.att-numpad-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
.att-numpad-btn:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.error-shake {
    animation: shake 0.5s;
}

.error-shake-border {
    border-color: var(--danger, #ef4444) !important;
}

/* Screensaver */
.screensaver-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(2, 6, 23, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
}
.screensaver-overlay.active {
    opacity: 1;
    pointer-events: all;
    cursor: pointer;
}
.att-clock-large {
    font-size: 5rem;
    font-weight: 200;
    color: #f8fafc;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    margin-bottom: 20px;
}
.att-tap-hint {
    color: #94a3b8;
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
