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

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a2e;
    padding: 24px 16px;
}

/* ── Card ── */

.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.10);
    padding: 48px 40px 40px;
    width: 100%;
    max-width: 460px;
}

/* ── Sub-card ── */

.sub-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

/* ── Logo ── */

.logo-wrap {
    text-align: center;
    margin-bottom: 32px;
}

.logo-wrap img {
    width: 100%;
    max-width: 280px;
    height: auto;
}

/* ── Typography ── */

h1 {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: #1a1a2e;
}

h2 {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: #374151;
    margin-bottom: 16px;
}

.subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 28px;
}

.company-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    margin-bottom: 4px;
}

.username {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 24px;
}

/* ── Divider ── */

.divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0 0 24px;
}

/* ── Form fields ── */

.field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.field-wrap {
    position: relative;
    margin-bottom: 20px;
}

.field-wrap input[type="password"],
.field-wrap input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    color: #1a1a2e;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.field-wrap input[type="password"]:focus,
.field-wrap input[type="text"]:focus {
    border-color: #4f6ef7;
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.15);
    background: #fff;
}

.field-wrap.has-toggle input[type="password"],
.field-wrap.has-toggle input[type="text"] {
    padding-right: 44px;
}

.toggle-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
    background: none;
    border: none;
    padding: 4px;
    display: flex;
    align-items: center;
}

.toggle-eye:hover { color: #4f6ef7; }

/* ── Buttons ── */

.btn-submit {
    display: block;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #4f6ef7 0%, #3a56d4 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 4px;
    text-decoration: none;
    text-align: center;
}

.btn-submit:hover { opacity: 0.92; }
.btn-submit:active { transform: scale(0.98); }

/* ── Messages ── */

.msg-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: #b91c1c;
}

.msg-success {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 16px;
    font-size: 0.875rem;
    color: #15803d;
}

.msg-icon { flex-shrink: 0; margin-top: 1px; }

/* ── Receipt: code entry ── */

.env-wrap {
    text-align: center;
    margin-bottom: 24px;
}

.env-wrap img {
    height: 48px;
    width: auto;
    margin-bottom: 8px;
}

.env {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
}

.kod-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
}

.kod-group {
    display: flex;
    flex: 1;
    gap: 5px;
}

.kod {
    flex: 1;
    min-width: 0;
    max-width: 48px;
    height: 52px;
    text-align: center;
    font-family: monospace;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    padding: 0;
}

.kod:focus {
    border-color: #4f6ef7;
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.15);
    background: #fff;
}

.kod-sep {
    font-size: 1.6rem;
    font-weight: 700;
    color: #d1d5db;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    body {
        padding: 0;
        align-items: flex-start;
    }
    .card {
        border-radius: 0;
        padding: 32px 12px 32px;
        min-height: 100vh;
    }
    .kod-wrap {
        gap: 6px;
    }
    .kod-group {
        flex: 0 0 auto;
        gap: 4px;
    }
    .kod {
        flex: 0 0 auto;
        width: calc((100vw - 75px) / 8);
        max-width: 44px;
        font-size: 1.1rem;
        height: 44px;
        border-width: 1px;
    }
    .kod-sep {
        font-size: 1.2rem;
    }
}

@media (max-width: 330px) {
    .recaptcha-wrap {
        transform: scale(0.88);
        transform-origin: center top;
        margin-bottom: 4px;
    }
}

.recaptcha-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* ── Receipt: found state ── */

.receipt-info {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.receipt-info-row {
    display: flex;
    justify-content: space-between;
    padding: 11px 16px;
    font-size: 0.875rem;
    gap: 12px;
}

.receipt-info-row:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.receipt-info-row:nth-child(even) {
    background: #f9fafb;
}

.receipt-info-label {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.receipt-info-value {
    color: #6b7280;
    text-align: right;
}

.link-center {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
    color: #4f6ef7;
    text-decoration: none;
}

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

.footer-text {
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 24px;
}

.footer-text a { color: #4f6ef7; text-decoration: none; }
.footer-text a:hover { text-decoration: underline; }
