* {
    box-sizing: border-box;
}

:root {
    --bg: #0f172a;
    --card: rgba(17, 24, 39, 0.92);
    --card-border: rgba(96, 165, 250, 0.22);
    --field-bg: #111827;
    --field-border: #374151;
    --text: #f9fafb;
    --muted: #9ca3af;
    --muted-light: #cbd5e1;
    --blue: #2563eb;
    --blue-hover: #1d4ed8;
    --blue-ring: rgba(37, 99, 235, 0.2);
    --red: #fecaca;
    --red-bg: rgba(127, 29, 29, 0.42);
    --red-border: rgba(248, 113, 113, 0.35);
    --green: #6ee7b7;
    --green-bg: rgba(6, 78, 59, 0.42);
    --green-border: rgba(110, 231, 183, 0.25);
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.32), transparent 34%),
        radial-gradient(circle at bottom right, rgba(6, 78, 59, 0.20), transparent 30%),
        var(--bg);
}

.auth-page {
    min-height: 100vh;
    padding: 24px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
}

.auth-card {
    width: min(100%, 440px);
    padding: 34px;
    border: 1px solid var(--card-border);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(31, 41, 55, 0.95), var(--card));
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.logo {
    max-width: 240px;
    width: 72%;
    height: auto;
    display: block;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 10px;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-header h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.auth-header p {
    margin: 12px auto 0;
    max-width: 340px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
}

.alert-error {
    border: 1px solid var(--red-border);
    background: var(--red-bg);
    color: var(--red);
}

.alert-success {
    border: 1px solid var(--green-border);
    background: var(--green-bg);
    color: var(--green);
}

.auth-form {
    display: grid;
    gap: 16px;
}

.field label,
.label-row label {
    display: block;
    color: var(--muted-light);
    font-size: 14px;
    font-weight: 800;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.label-row a,
.auth-note a {
    color: #93c5fd;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.label-row a:hover,
.auth-note a:hover {
    text-decoration: underline;
}

.field > label {
    margin-bottom: 7px;
}

.field input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--field-border);
    border-radius: 12px;
    outline: none;
    background: var(--field-bg);
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input::placeholder {
    color: #6b7280;
}

.field input:focus {
    border-color: #60a5fa;
    background: #0b1220;
    box-shadow: 0 0 0 4px var(--blue-ring);
}

.primary-button {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
    transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.primary-button:hover {
    background: var(--blue-hover);
    transform: translateY(-1px);
}

.primary-button:active {
    transform: translateY(0);
}



.link-button {
    display: grid;
    place-items: center;
    text-decoration: none;
}

.auth-divider {
    position: relative;
    margin: 24px 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(148, 163, 184, 0.16);
}

.auth-divider::before {
    margin-right: 14px;
}

.auth-divider::after {
    margin-left: 14px;
}

.store-access-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    padding: 13px 16px;
    border: 1px solid rgba(110, 231, 183, 0.36);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 78, 59, 0.38)),
        rgba(15, 23, 42, 0.58);
    color: #ecfdf5;
    text-align: center;
    text-decoration: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 16px 30px rgba(6, 78, 59, 0.18);
    transition:
        transform 0.14s ease,
        border-color 0.14s ease,
        background 0.14s ease,
        box-shadow 0.14s ease;
}

.store-access-button:hover {
    transform: translateY(-1px);
    border-color: rgba(110, 231, 183, 0.62);
    background:
        linear-gradient(135deg, rgba(16, 185, 129, 0.30), rgba(6, 78, 59, 0.48)),
        rgba(15, 23, 42, 0.74);
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.20),
        0 0 0 4px rgba(16, 185, 129, 0.10);
}

.store-access-button:active {
    transform: translateY(0);
}

.store-access-button strong {
    display: block;
    color: #f0fdf4;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
}

.store-access-button small {
    display: block;
    margin-top: 4px;
    color: #a7f3d0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.auth-note {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

.page-footer {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 520px) {
    .auth-page {
        padding: 14px;
    }

    .auth-card {
        padding: 24px;
        border-radius: 22px;
    }

    .logo {
        max-width: 210px;
    }

    .auth-header h1 {
        font-size: 32px;
    }

    .label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

.store-page {
    align-content: center;
}

.store-card {
    width: min(100%, 720px);
}

.store-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.compact-logo {
    justify-content: flex-start;
    margin-bottom: 0;
}

.compact-logo .logo {
    width: 220px;
    max-width: 60vw;
}

.logout-link {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    background: rgba(15, 23, 42, 0.45);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.logout-link:hover {
    border-color: rgba(96, 165, 250, 0.38);
    color: #fff;
    background: rgba(37, 99, 235, 0.16);
}

.store-header {
    text-align: left;
    margin-bottom: 24px;
}

.store-header p {
    margin-left: 0;
    margin-right: 0;
    max-width: 560px;
}

.store-header strong {
    color: #f9fafb;
}

.store-grid {
    display: grid;
    gap: 14px;
}

.store-tile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.42);
    color: var(--text);
    text-decoration: none;
    transition:
        transform 0.14s ease,
        border-color 0.14s ease,
        background 0.14s ease,
        box-shadow 0.14s ease;
}

.store-tile:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.42);
    background: rgba(37, 99, 235, 0.13);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.store-badge {
    min-width: 64px;
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--blue), #60a5fa);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.store-info {
    min-width: 0;
}

.store-info strong {
    display: block;
    color: #fff;
    font-size: 16px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-info span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.store-arrow {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.12);
    font-size: 18px;
    font-weight: 900;
}

@media (max-width: 620px) {
    .store-card {
        width: min(100%, 440px);
    }

    .store-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .compact-logo .logo {
        width: 210px;
        max-width: 100%;
    }

    .logout-link {
        align-self: flex-start;
    }

    .store-header {
        text-align: center;
    }

    .store-header p {
        margin-left: auto;
        margin-right: auto;
    }

    .store-tile {
        grid-template-columns: auto 1fr;
    }

    .store-arrow {
        display: none;
    }

    .store-info strong {
        white-space: normal;
    }
}

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 72px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.82);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    backdrop-filter: blur(16px);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.app-brand img {
    height: 38px;
    width: auto;
    display: block;
}

.app-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu {
    position: relative;
}

.user-menu summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 12px 0 6px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.72);
    color: var(--text);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-menu summary:hover {
    border-color: rgba(96, 165, 250, 0.38);
    background: rgba(37, 99, 235, 0.12);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--blue), #60a5fa);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.26);
}

.user-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 800;
}

.chevron {
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    transform: translateY(-1px);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

.user-dropdown-header {
    padding: 10px 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    margin-bottom: 6px;
}

.user-dropdown-header strong {
    display: block;
    color: #fff;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-header span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown a {
    display: block;
    padding: 10px 10px;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.user-dropdown a:hover {
    background: rgba(37, 99, 235, 0.14);
    color: #fff;
}

.user-dropdown .danger-link {
    color: #fecaca;
}

.user-dropdown .danger-link:hover {
    background: rgba(127, 29, 29, 0.30);
    color: #fff;
}

.app-page {
    min-height: calc(100vh - 72px);
    padding: 32px 24px 24px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
}

.centered-logo {
    justify-content: center;
}

@media (max-width: 620px) {
    .app-navbar {
        height: 66px;
        padding: 0 14px;
    }

    .app-brand img {
        height: 32px;
    }

    .user-name {
        display: none;
    }

    .user-menu summary {
        padding-right: 8px;
    }

    .user-dropdown {
        width: min(260px, calc(100vw - 28px));
    }

    .app-page {
        min-height: calc(100vh - 66px);
        padding: 20px 14px 14px;
    }
}