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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.background-decoration {
    position: absolute;
    width: 31.25rem;
    height: 31.25rem;
    background: radial-gradient(circle, rgba(255, 140, 0, 0.08) 0%, rgba(255, 140, 0, 0) 70%);
    border-radius: 50%;
    top: -6.25rem;
    right: -6.25rem;
    animation: float 6s ease-in-out infinite;
}

.background-decoration::before {
    content: '';
    position: absolute;
    width: 25rem;
    height: 25rem;
    background: radial-gradient(circle, rgba(255, 140, 0, 0.06) 0%, rgba(255, 140, 0, 0) 70%);
    border-radius: 50%;
    bottom: -9.375rem;
    left: -6.25rem;
    animation: float 8s ease-in-out infinite reverse;
}

.container {
    width: 100%;
    max-width: 37.5rem;
    padding: 1.25rem;
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    animation: fadeIn 0.8s ease-in;
}

.logo-wrapper {
    position: relative;
    animation: slideDown 0.8s ease-out;
}

.logo {
    max-width: 21.25rem;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0.9375rem 2.5rem rgba(255, 140, 0, 0.15));
    transition: filter 0.3s ease;
}

.logo-wrapper:hover .logo {
    filter: drop-shadow(0 1.25rem 3.125rem rgba(255, 140, 0, 0.25));
}

.btn-login {
    display: inline-block;
    padding: 1rem 3.5rem;
    background: linear-gradient(135deg, #ff8c00 0%, #ff7700 100%);
    color: white;
    border: none;
    border-radius: 3.125rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0.75rem 2.1875rem rgba(255, 140, 0, 0.3);
    animation: slideUp 0.8s ease-out;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.03125rem;
    margin-bottom: 2rem;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.btn-login:hover {
    transform: translateY(-0.25rem) scale(1.05);
    box-shadow: 0 1.125rem 3.125rem rgba(255, 140, 0, 0.4);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(-0.125rem) scale(0.98);
}

.btn-login:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-login:disabled:hover {
    transform: none;
    box-shadow: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-3.75rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(3.75rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-1.875rem);
    }
}

@media (max-width: 30rem) {
    html {
        font-size: 14px;
    }

    .logo {
        max-width: 16.25rem;
    }

    .btn-login {
        padding: 0.875rem 3rem;
        font-size: 0.9375rem;
    }

    .background-decoration {
        width: 18.75rem;
        height: 18.75rem;
        top: -3.125rem;
        right: -3.125rem;
    }

    .background-decoration::before {
        width: 15.625rem;
        height: 15.625rem;
        bottom: -9.375rem;
        left: -6.25rem;
    }
}

@keyframes fade {
    from { opacity: 1.0; }
    50% { opacity: 0.4; }
    to { opacity: 1.0; }
}

.blink {
    -webkit-animation:fade 3000ms infinite;
    animation:fade 3000ms infinite;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
    padding: 2rem;
    backdrop-filter: blur(18px);
}

.login-card h1 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: #2e2e2e;
    text-align: center;
}

.login-card label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #4d4d4d;
}

.login-card input {
    width: 100%;
    padding: 0.95rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(102, 102, 102, 0.16);
    border-radius: 14px;
    background: #f9f9f9;
    font-size: 1rem;
    color: #2f2f2f;
}

.login-card input:focus {
    outline: none;
    border-color: rgba(255, 140, 0, 0.6);
    box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.12);
}

.login-card .btn-login {
    width: 100%;
}

.login-message {
    margin-top: 1rem;
    font-size: 0.95rem;
    text-align: center;
    color: #555;
}

.login-message.error {
    color: #d14141;
}

.login-message.success {
    color: #2f7a2f;
}

.main-page {
    --main-header-height: clamp(4.4rem, 12svh, 5.5rem);
    --main-downbar-height: clamp(4.25rem, 11svh, 4.9rem);
    --main-side-padding: clamp(1rem, 5vw, 1.5rem);
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
}

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
    width: 100%;
    min-height: var(--main-header-height);
    padding: max(0.7rem, env(safe-area-inset-top)) var(--main-side-padding) 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(46, 46, 46, 0.08);
    backdrop-filter: blur(18px);
}

.main-logo {
    width: clamp(7.5rem, 38vw, 11.5rem);
    max-height: calc(var(--main-header-height) - 1.25rem);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0.75rem 1.75rem rgba(255, 140, 0, 0.16));
}

.logout-button {
    position: absolute;
    right: var(--main-side-padding);
    top: 50%;
    width: clamp(2.55rem, 11vw, 3rem);
    height: clamp(2.55rem, 11vw, 3rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ff7700;
    background: #ffffff;
    border: 1px solid rgba(255, 140, 0, 0.22);
    border-radius: 50%;
    box-shadow: 0 0.75rem 1.5rem rgba(255, 140, 0, 0.15);
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.logout-button:hover {
    background: #fff7ef;
    box-shadow: 0 1rem 2rem rgba(255, 140, 0, 0.22);
    transform: translateY(-50%) scale(1.04);
}

.logout-button svg,
.downbar-item svg {
    width: clamp(1.25rem, 5vw, 1.45rem);
    height: clamp(1.25rem, 5vw, 1.45rem);
    fill: currentColor;
}

.main-home {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    padding:
        calc(var(--main-header-height) + 1rem)
        var(--main-side-padding)
        calc(var(--main-downbar-height) + max(1rem, env(safe-area-inset-bottom)));
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-hero {
    width: 100%;
    max-width: 26rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.7s ease-in;
}

.user-photo-ring {
    width: clamp(7.25rem, min(42vw, 24svh), 13rem);
    aspect-ratio: 1;
    flex: 0 0 auto;
    padding: clamp(0.26rem, 1vw, 0.35rem);
    margin-bottom: clamp(0.85rem, 3svh, 1.3rem);
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8c00 0%, #ff7700 100%);
    box-shadow: 0 clamp(1rem, 4svh, 1.5rem) 3.5rem rgba(255, 140, 0, 0.24);
}

.user-photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: 0.28rem solid #ffffff;
    border-radius: 50%;
    background: #ffffff;
}

.user-name {
    width: 100%;
    margin-bottom: clamp(0.85rem, 3svh, 1.25rem);
    color: #2e2e2e;
    font-size: clamp(1.35rem, 7vw, 2.4rem);
    font-weight: 800;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.start-shift-button,
.end-shift-button {
    width: min(100%, 15rem);
    min-height: 3.25rem;
    padding: 0.95rem 1.8rem;
    margin-bottom: 0;
    white-space: normal;
}

.end-shift-button {
    margin-top: 0.75rem;
    background: linear-gradient(135deg, #2e2e2e 0%, #1b1b1b 100%);
    box-shadow: 0 0.75rem 2.1875rem rgba(27, 27, 27, 0.24);
}

.end-shift-button:hover {
    box-shadow: 0 1.125rem 3.125rem rgba(27, 27, 27, 0.32);
}

.end-shift-button[hidden] {
    display: none;
}

.downbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    min-height: var(--main-downbar-height);
    padding: 0.5rem var(--main-side-padding) max(0.5rem, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid rgba(46, 46, 46, 0.08);
    backdrop-filter: blur(18px);
}

.downbar-item {
    min-width: clamp(4.75rem, 28vw, 5.75rem);
    min-height: clamp(3rem, 9svh, 3.35rem);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: #6a6a6a;
    background: transparent;
    border: none;
    border-radius: 0.85rem;
    cursor: pointer;
    font-size: clamp(0.72rem, 3.5vw, 0.8rem);
    font-weight: 700;
}

.downbar-item.active {
    color: #ff7700;
    background: rgba(255, 140, 0, 0.1);
}

.logout-button:focus-visible,
.downbar-item:focus-visible,
.start-shift-button:focus-visible,
.end-shift-button:focus-visible {
    outline: 3px solid rgba(255, 140, 0, 0.28);
    outline-offset: 4px;
}

@media (max-width: 30rem) {
    .main-page {
        --main-header-height: clamp(4.1rem, 11svh, 4.85rem);
        --main-downbar-height: clamp(4rem, 10svh, 4.55rem);
        --main-side-padding: clamp(0.85rem, 4.5vw, 1.1rem);
    }

    .btn-login.start-shift-button,
    .btn-login.end-shift-button {
        border-radius: 1.7rem;
    }

    .user-name {
        max-width: 18rem;
    }
}

@media (max-width: 22.5rem) {
    .main-page {
        --main-header-height: 4rem;
        --main-downbar-height: 3.9rem;
        --main-side-padding: 0.75rem;
    }

    .main-logo {
        width: 7rem;
    }

    .logout-button {
        width: 2.4rem;
        height: 2.4rem;
    }

    .user-photo-ring {
        width: clamp(6.5rem, min(40vw, 22svh), 8.5rem);
    }

    .user-name {
        font-size: clamp(1.2rem, 6.5vw, 1.55rem);
    }

    .start-shift-button,
    .end-shift-button {
        width: min(100%, 13rem);
        min-height: 3rem;
        padding: 0.85rem 1.2rem;
        font-size: 0.92rem;
    }

    .downbar-item {
        min-width: 4.35rem;
        min-height: 2.85rem;
    }
}

@media (max-height: 42rem) {
    .main-page {
        --main-header-height: clamp(3.85rem, 13svh, 4.6rem);
        --main-downbar-height: clamp(3.75rem, 12svh, 4.35rem);
    }

    .main-home {
        padding-top: calc(var(--main-header-height) + 0.65rem);
        padding-bottom: calc(var(--main-downbar-height) + max(0.65rem, env(safe-area-inset-bottom)));
    }

    .user-photo-ring {
        width: clamp(6.75rem, min(34vw, 22svh), 10rem);
        margin-bottom: 0.75rem;
    }

    .user-name {
        margin-bottom: 0.75rem;
    }

    .start-shift-button,
    .end-shift-button {
        min-height: 3rem;
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }
}

@media (max-height: 34rem) {
    .main-page {
        --main-header-height: 3.65rem;
        --main-downbar-height: 3.55rem;
    }

    .main-logo {
        width: 7rem;
    }

    .logout-button {
        width: 2.35rem;
        height: 2.35rem;
    }

    .user-photo-ring {
        width: clamp(5.75rem, 19svh, 7.25rem);
    }
}

@media (orientation: landscape) and (max-height: 31rem) {
    .main-home {
        align-items: center;
    }

    .user-hero {
        max-width: min(38rem, 100%);
        flex-direction: row;
        justify-content: center;
        gap: clamp(1rem, 5vw, 2rem);
        text-align: left;
    }

    .user-photo-ring {
        width: clamp(5.5rem, 27svh, 7.5rem);
        margin-bottom: 0;
    }

    .user-name {
        max-width: 15rem;
        margin-bottom: 0.8rem;
        font-size: clamp(1.2rem, 4vw, 1.7rem);
    }

    .start-shift-button,
    .end-shift-button {
        width: min(13rem, 42vw);
    }

    .downbar {
        min-height: var(--main-downbar-height);
    }

    .downbar-item {
        flex-direction: row;
        min-height: 2.65rem;
        gap: 0.4rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .logout-button:hover {
        background: #ffffff;
        box-shadow: 0 0.75rem 1.5rem rgba(255, 140, 0, 0.15);
        transform: translateY(-50%);
    }

    .btn-login:hover {
        transform: none;
    }
}

@media screen and (prefers-color-scheme: dark) {
    body {
        background-image:linear-gradient(to bottom, #585858 0%, #1B1B1B 51%);
    }

    .main-page {
        background: linear-gradient(to bottom, #585858 0%, #1B1B1B 51%);
    }

    .main-header,
    .downbar {
        background: rgba(32, 32, 32, 0.88);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .logout-button {
        background: #2a2a2a;
    }

    .user-name {
        color: #ffffff;
    }

    .downbar-item {
        color: #cfcfcf;
    }

    .downbar-item.active {
        color: #ff8c00;
        background: rgba(255, 140, 0, 0.16);
    }
}
