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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #1b1b1b;
    background-color: #eff3f8;
    background-image:
        radial-gradient(ellipse at 10% 50%,  rgba(190, 215, 240, 0.7) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 20%,  rgba(200, 220, 245, 0.6) 0%, transparent 45%),
        radial-gradient(ellipse at 60% 85%,  rgba(175, 205, 235, 0.4) 0%, transparent 40%);
    background-attachment: fixed;
    padding: 20px;
}

/* Outer wrapper stacks the main card + options tile */
.ms-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 448px;
}

/* Main white card */
.ms-tile {
    background: #fff;
    padding: 44px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* Logo row: 4-square icon + brand name */
.ms-logo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.ms-brand {
    font-size: 19px;
    font-weight: 600;
    color: #1b1b1b;
}

/* Page heading */
.ms-title {
    font-size: 28px;
    font-weight: 600;
    color: #1b1b1b;
    margin-bottom: 20px;
    line-height: 1.2;
}

/* Step 2 — back button + email chip */
.ms-email-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: #1b1b1b;
    flex-shrink: 0;
}

.back-btn:hover {
    background: #f2f2f2;
}

.ms-email-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #8a8886;
    border-radius: 2px;
    padding: 3px 10px;
    font-size: 13px;
    color: #1b1b1b;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Input field — bottom border only, static placeholder */
.ms-field {
    margin-bottom: 12px;
}

.ms-input {
    display: block;
    width: 100%;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid #605e5c;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: #1b1b1b;
    outline: none;
    transition: border-color .1s;
}

.ms-input::placeholder {
    color: #605e5c;
}

.ms-input:focus {
    border-bottom: 2px solid #0067b8;
    padding-bottom: 7px;
}

/* "Nie masz konta? Utwórz je!" row */
.ms-hint {
    font-size: 13px;
    color: #1b1b1b;
    margin-bottom: 6px;
}

/* Standalone blue links */
.ms-link {
    display: block;
    font-size: 13px;
    color: #0067b8;
    text-decoration: none;
    margin-bottom: 8px;
}

.ms-link:hover {
    text-decoration: underline;
}

/* Button row — right-aligned */
.ms-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
}

.ms-btn {
    background: #0067b8;
    color: #fff;
    border: none;
    padding: 0 24px;
    height: 36px;
    min-width: 108px;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.ms-btn:hover {
    background: #106ebe;
}

.ms-btn:active {
    background: #005a9e;
}

/* "Opcje logowania" tile below main card */
.ms-options-tile {
    background: #fff;
    padding: 14px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    color: #1b1b1b;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.ms-options-tile:hover {
    background: #f9f9f9;
}

/* Page-level footer links */
.ms-footer {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    font-size: 12px;
}

.ms-footer a {
    color: #605e5c;
    text-decoration: none;
}

.ms-footer a:hover {
    text-decoration: underline;
}

/* ── Step 3: 2FA waiting screen ──────────────────────────── */
.ms-2fa-desc {
    font-size: 14px;
    color: #605e5c;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ms-2fa-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    margin: 12px 0 24px;
}

.ms-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f2f2f2;
    border-top-color: #0067b8;
    border-radius: 50%;
    animation: ms-spin 1s linear infinite;
}

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

.ms-challenge-number {
    font-size: 56px;
    font-weight: 700;
    color: #1b1b1b;
    letter-spacing: 8px;
    line-height: 1;
}

/* Responsive */
@media (max-width: 520px) {
    body { padding: 0; }
    .ms-tile { padding: 32px 24px; box-shadow: none; }
    .ms-options-tile { box-shadow: none; }
    .ms-wrap { gap: 0; }
    .ms-footer { padding: 16px; }
}
