:root {
    --auth-blue: #1558d6;
    --auth-blue-dark: #0b327f;
    --auth-text: #172033;
    --auth-muted: #64748b;
    --auth-line: #e2e8f0;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 32px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-text);
    font-family: "Trebuchet MS", Arial, sans-serif;
    background:
        linear-gradient(rgba(8, 36, 95, 0.2), rgba(8, 36, 95, 0.2)),
        url("../image/shoepic.jpg") center / cover fixed,
        #f4f7fb;
}

.auth-shell {
    width: min(100%, 760px);
}

.auth-brand {
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 20px;
    color: #fff;
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.auth-brand img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.25);
}

.auth-card {
    padding: clamp(24px, 5vw, 42px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 24px 70px rgba(8, 36, 95, 0.28);
}

.auth-eyebrow {
    margin: 0 0 8px;
    color: var(--auth-blue);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.auth-card h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    line-height: 1.15;
}

.auth-intro {
    margin: 10px 0 26px;
    color: var(--auth-muted);
}

.role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.role-option {
    padding: 23px;
    border: 1px solid var(--auth-line);
    border-radius: 16px;
    background: linear-gradient(160deg, #fff, #f4f8ff);
}

.role-option h2 {
    margin: 8px 0 4px;
    font-size: 1.2rem;
}

.role-option p,
.auth-note {
    color: var(--auth-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.role-icon {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: #eaf1ff;
    font-size: 1.35rem;
}

.auth-button {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563d8, #0b45bc);
    box-shadow: 0 8px 18px rgba(21, 88, 214, 0.2);
    color: #fff;
    font: inherit;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.auth-button:hover {
    filter: brightness(1.06);
}

.email-avatar-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 9px;
    padding: 10px 12px;
    border: 1px solid #dce5f0;
    border-radius: 12px;
    background: #f7faff;
    color: var(--auth-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.email-avatar-preview[hidden] {
    display: none;
}

.email-avatar-preview img {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    object-fit: cover;
}

.google-auth-button {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding: 9px 13px;
    border: 1px solid #d5deeb;
    border-radius: 10px;
    background: #fff;
    color: #27364d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.google-auth-button:hover {
    border-color: #aebdd2;
    background: #f8faff;
}

.google-auth-button[hidden],
.google-auth-note[hidden] {
    display: none;
}

.google-letter {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border: 1px solid #d9e1eb;
    border-radius: 50%;
    color: #2867a8;
    font-weight: 800;
}

.google-auth-note {
    margin: 7px 0 0;
    color: var(--auth-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.google-auth-button {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding: 9px 13px;
    border: 1px solid #d5deeb;
    border-radius: 10px;
    background: #fff;
    color: #27364d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.google-auth-button:hover {
    border-color: #aebdd2;
    background: #f8faff;
}

.google-auth-button[hidden],
.google-auth-note[hidden] {
    display: none;
}

.google-letter {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border: 1px solid #d9e1eb;
    border-radius: 50%;
    color: #2867a8;
    font-weight: 800;
}

.google-auth-note {
    margin: 7px 0 0;
    color: var(--auth-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.auth-button-dark {
    background: linear-gradient(135deg, #263b63, #142849);
}

.auth-secondary {
    display: block;
    margin-top: 14px;
    color: var(--auth-blue);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.auth-note {
    display: block;
    margin-top: 14px;
    font-size: 0.8rem;
}

.auth-note-block {
    padding: 11px 13px;
    border-radius: 10px;
    background: #f1f5f9;
}

.auth-form-card {
    width: min(100%, 520px);
    margin: 0 auto;
}

.account-form {
    display: flex;
    flex-direction: column;
}

.account-form label {
    margin: 13px 0 6px;
    font-size: 0.92rem;
    font-weight: 700;
}

.account-form input,
.account-form textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: var(--auth-text);
    font: inherit;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: var(--auth-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
}

.account-form textarea {
    resize: vertical;
}

.account-form input:focus,
.account-form textarea:focus,
.account-form select:focus {
    outline: 3px solid rgba(99, 102, 241, 0.16);
    border-color: var(--auth-blue);
}

.ph-address-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 13px;
    margin: 10px 0 4px;
}

.ph-address-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ph-address-field label {
    margin: 8px 0 6px;
    font-size: 0.87rem;
    font-weight: 700;
}

.ph-address-field input,
.ph-address-field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: var(--auth-text);
    font: inherit;
}

.ph-address-field select:disabled {
    color: #8490a1;
    background: #f1f5f9;
}

.ph-address-error {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    color: #b42318;
    font-size: 0.84rem;
}

.account-form button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.field-hint {
    margin: 5px 0 0;
    color: var(--auth-muted);
    font-size: 0.8rem;
}

.auth-form-foot {
    margin: 20px 0 0;
    text-align: center;
}

.auth-form-foot a,
.back-link {
    color: var(--auth-blue);
    font-weight: 700;
    text-decoration: none;
}

.auth-message {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
}

.auth-message.error {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #b42318;
}

.auth-message.success {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.auth-logout {
    margin-top: 22px;
    text-align: center;
}

.auth-text-button {
    padding: 4px;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.back-link {
    display: block;
    width: fit-content;
    margin: 18px auto 0;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.register-body {
    padding: 14px 18px;
}

.register-shell {
    width: min(100%, 820px);
}

.register-shell .auth-brand {
    margin-bottom: 10px;
}

.register-shell .auth-brand img {
    width: 42px;
    height: 42px;
}

.register-card {
    width: 100%;
    padding: clamp(18px, 3vw, 28px);
}

.register-card .auth-intro {
    margin: 6px 0 10px;
}

.register-security-note {
    margin: 0 0 8px;
    padding: 8px 11px;
}

.register-personal-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

.register-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.register-field label {
    margin: 8px 0 5px;
    font-size: 0.87rem;
}

.register-field input {
    min-height: 42px;
    padding: 9px 11px;
}

.register-field .field-hint {
    margin-top: 3px;
}

.register-account-form .ph-address-fields {
    margin-top: 3px;
}

.register-account-form > .auth-button {
    margin-top: 12px;
}

.register-form-foot {
    margin-top: 12px;
}

.register-shell > .back-link {
    margin-top: 10px;
}

@media (max-width: 560px) {
    .role-options {
        grid-template-columns: 1fr;
    }

    .role-option {
        padding: 18px;
    }

    .ph-address-fields {
        grid-template-columns: 1fr;
    }

    .register-body {
        align-items: flex-start;
        padding: 14px 12px;
    }

    .register-personal-fields {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 380px) and (max-width: 560px) {
    .register-personal-fields,
    .register-account-form .ph-address-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
