:root {
    --color-background: #f4f7f6;
    --color-surface: #ffffff;
    --color-primary: #1a1a1a;
    --color-primary-hover: #333333;
    --color-text-main: #1a1a1a;
    --color-text-muted: #737373;
    --color-border: #e5e5e5;
    --color-danger: #e11d48;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-accent: #f3f4f6;

    --radius-main: 12px;
    --radius-small: 8px;
    --radius-full: 9999px;

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
}

body.page {
    font-family: var(--font-main);
    background-color: var(--color-background);
    color: var(--color-text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.is-hidden {
    display: none !important;
}

.navigation-bar {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
}

.back-button {
    width: 44px;
    height: 44px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.back-button:hover {
    background: var(--color-accent);
}

.back-button:active {
    transform: scale(0.95);
}

.session-timer {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--color-surface);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 100;
}

.session-timer__progress {
    width: 60px;
    height: 4px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.session-timer__bar {
    height: 100%;
    background: var(--color-primary);
    width: 100%;
    transition: width 1s linear, background-color 0.3s;
}

.session-timer__bar.is-warning {
    background: var(--color-warning);
}

.session-timer__bar.is-danger {
    background: var(--color-danger);
}

.loader {
    position: fixed;
    inset: 0;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loader__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-accent);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.application {
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-main);
    border: 1px solid var(--color-border);
    padding: 2rem;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card__description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.auth-input {
    background: var(--color-accent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-input--active {
    border-color: var(--color-primary);
    background: white;
}

.auth-input__field {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    letter-spacing: 0.25em;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.keypad__button {
    height: 60px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.keypad__button:active {
    background: var(--color-accent);
    transform: scale(0.98);
}

.keypad__button--primary {
    background: var(--color-primary);
    color: white;
    border: none;
}

.keypad__button--primary:active {
    background: var(--color-primary-hover);
}

.keypad__button--danger {
    color: var(--color-danger);
}

.button {
    width: 100%;
    height: 52px;
    border-radius: var(--radius-small);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.15s;
}

.button--primary {
    background: var(--color-primary);
    color: white;
    border: none;
}

.button--secondary {
    background: var(--color-accent);
    border: none;
}

.button--danger-text {
    border: none;
    background: transparent;
    color: var(--color-danger);
}

.calendar-wrapper {
    position: relative;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.calendar-days {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 2px 0;
    scrollbar-width: none;
    scroll-behavior: smooth;
    flex: 1;
}

.calendar-days::-webkit-scrollbar {
    display: none;
}

.calendar-control {
    width: 40px;
    height: 72px;
    background: var(--color-accent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--color-text-main);
}

.calendar-control:hover {
    background: var(--color-border);
}

.calendar-control:active {
    transform: scale(0.95);
}

.calendar-control.is-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
    background: var(--color-accent) !important;
}

.day-selector {
    flex: 0 0 64px;
    height: 72px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: white;
}

.day-selector--active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.day-selector__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.day-selector__value {
    font-size: 1.125rem;
    font-weight: 700;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.slots-grid::-webkit-scrollbar {
    width: 4px;
}

.slots-grid::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.slot-selector {
    height: 52px;
    background: var(--color-accent);
    border-radius: var(--radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.1s;
}

.slot-selector:hover {
    background: var(--color-primary);
    color: white;
}

.appointment-status {
    background: var(--color-accent);
    padding: 1.25rem;
    border-radius: var(--radius-small);
    margin-bottom: 1.5rem;
}

.appointment-status__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

.appointment-status__value {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay--active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-main);
    width: 100%;
    max-width: 360px;
    padding: 1.5rem;
    text-align: center;
    transform: translateY(10px);
    transition: transform 0.2s;
}

.modal-overlay--active .modal {
    transform: translateY(0);
}

.modal__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.modal__text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.modal__actions {
    display: flex;
    gap: 0.75rem;
}

.success-view {
    text-align: center;
}

.success-view__icon {
    width: 64px;
    height: 64px;
    background: #ecfdf5;
    color: var(--color-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.employee-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.employee-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.employee-post {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.calendar-footer {
    margin-top: 2rem;
}

.success-details {
    background: var(--color-accent);
    padding: 1rem;
    border-radius: var(--radius-small);
    margin-bottom: 2rem;
}

.success-text {
    font-weight: 600;
    font-size: 1rem;
}
