* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

#login-screen {
    position: relative;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
    background:
        radial-gradient(circle at 18% 18%, rgba(59, 130, 246, 0.11), transparent 24%),
        radial-gradient(circle at 82% 80%, rgba(124, 58, 237, 0.14), transparent 26%),
        linear-gradient(135deg, #09090b 0%, #111827 48%, #312e81 100%);
}

#login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.28) 100%);
    z-index: 0;
}

.screen {
    min-height: 100vh;
}

/* Login Screen */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    margin-top: 20vh;
}

.login-scene {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.login-scene__glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(25px);
    opacity: 0.72;
}

.login-scene__glow--left {
    width: 260px;
    height: 260px;
    top: -40px;
    left: -60px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.26), transparent 68%);
}

.login-scene__glow--right {
    width: 360px;
    height: 360px;
    right: -120px;
    bottom: -140px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.24), transparent 70%);
}

.login-scene__noise {
    position: absolute;
    inset: 0;
    opacity: 0.035;
    background-image:
        linear-gradient(0deg, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.8) 1px, transparent 1px);
    background-size: 3px 3px;
    mix-blend-mode: soft-light;
}

.login-scene__lines {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 22% 78%, transparent 0 32%, rgba(255, 255, 255, 0.055) 32.5%, transparent 33%),
        radial-gradient(circle at 76% 24%, transparent 0 37%, rgba(255, 255, 255, 0.045) 37.4%, transparent 38%),
        radial-gradient(circle at 50% 50%, transparent 0 58%, rgba(255, 255, 255, 0.03) 58.3%, transparent 59%);
    opacity: 0.4;
}

.login-shell {
    position: relative;
    z-index: 2;
    min-height: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 395px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform-origin: center;
    animation: cardIn 1.12s cubic-bezier(0.12, 0.96, 0.24, 1) both;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%);
    pointer-events: none;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.login-logo__ring {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font-size: 1.65rem;
}

.login-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.5rem);
    line-height: 1.05;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.login-subtitle {
    margin: 10px 0 0;
    font-size: 0.98rem;
    color: #94a3b8;
    font-weight: 400;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-field {
    margin-bottom: 0;
    display: grid;
    gap: 8px;
}

.login-label {
    font-size: 0.92rem;
    color: #dbe4f0;
    font-weight: 500;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    min-height: 56px;
}

.login-input-wrap:focus-within {
    border-color: rgba(79, 110, 247, 0.9);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.18);
}

.login-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    color: #9fb3cf;
    font-size: 1rem;
    flex: 0 0 auto;
}

.login-input {
    flex: 1 1 auto;
    width: 100%;
    height: 56px;
    background: transparent;
    border: 0;
    outline: none;
    padding: 0 16px 0 0;
    color: #ffffff;
    font-size: 0.98rem;
    font-family: inherit;
}

.login-input::placeholder {
    color: #cbd5e1;
    opacity: 0.8;
}

.login-input-wrap--password .login-input {
    padding-right: 8px;
}

.login-password-toggle {
    height: 56px;
    width: 54px;
    border: 0;
    background: transparent;
    color: #9fb3cf;
    cursor: pointer;
}

.login-password-toggle:hover {
    color: #ffffff;
}

.login-button {
    height: 56px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #4f6ef7, #3b82f6);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.22);
}

.login-options {
    margin-top: -4px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #dbe4f0;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.remember-option__input {
    width: 16px;
    height: 16px;
    accent-color: #4f6ef7;
}

.login-alert {
    margin-top: 2px;
    margin-bottom: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.login-footer {
    text-align: center;
    margin-top: 18px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.login-footer p {
    margin: 0;
}

@keyframes cardIn {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Main Screen */
#main-screen {
    background: #f5f5f5;
}

.header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.status-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.status-text {
    font-size: 0.8rem;
    color: #666;
}

/* Punch Section */
.punch-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    text-align: center;
}

.event-type-selector {
    margin-bottom: 1.5rem;
}

.event-type-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.event-type-selector select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn-punch {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-punch:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-punch:active {
    transform: scale(0.95);
}

/* Events Section */
.events-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.events-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.event-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.event-time {
    font-weight: bold;
    color: #667eea;
}

.event-type {
    color: #666;
}

/* Form Elements */
.form-group:not(.login-field) {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group:not(.login-field) label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group:not(.login-field) input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group:not(.login-field) input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #5568d3;
}

.btn-primary {
    background: #667eea;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

/* Messages */
.message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    display: block;
}

.error-message {
    margin-top: 1rem;
    color: #721c24;
    display: none;
}

.error-message.show {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    #login-screen {
        min-height: 100dvh;
        overflow-y: auto;
    }

    .login-shell {
        min-height: 100dvh;
        height: auto;
        padding: 18px;
    }

    .login-card {
        padding: 24px;
    }

    .status-cards {
        grid-template-columns: 1fr;
    }
    
    .btn-punch {
        width: 160px;
        height: 160px;
        font-size: 1.25rem;
    }
}
