/* ── Action buttons ─────────────────────────────────────────────────── */

.action-button {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background-color: var(--draivi-color-1, #3498db) !important;
    color: #fff !important;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    -webkit-transition: opacity 0.2s ease;
    transition: opacity 0.2s ease;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    min-height: 50px;
    text-decoration: none;
}

.action-button:hover,
.action-button:focus {
    opacity: 0.88;
    color: #fff !important;
}

/* ── Button loading spinner ──────────────────────────────────────────── */

.submit-button {
    position: relative;
}

.submit-button.active::before {
    content: "";
    display: block;
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    -webkit-animation: core-spin 0.8s linear infinite;
            animation: core-spin 0.8s linear infinite;
    left: 50%;
    top: 50%;
    -webkit-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
}

.submit-button.active {
    color: transparent !important;
    cursor: not-allowed;
}

@-webkit-keyframes core-spin {
    to {
        -webkit-transform: translate(-50%, -50%) rotate(360deg);
                transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes core-spin {
    to {
        -webkit-transform: translate(-50%, -50%) rotate(360deg);
                transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ── Utilities ───────────────────────────────────────────────────────── */

.simple-spacing {
    margin-top: 10px;
    margin-bottom: 10px;
}

.error-text {
    color: #d11;
}

span.has-error {
    color: #d11;
    font-size: 0.85rem;
    display: block;
    margin-top: 4px;
}

/* ── Censored email badge ────────────────────────────────────────────── */

.core-censored-email {
    display: inline-block;
    font-family: monospace;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    padding: 1px 7px;
}

/* ── Cancel link ─────────────────────────────────────────────────────── */

.core-cancel-link {
    display: block;
    text-align: center;
    color: #888;
    font-size: 0.875rem;
    margin-top: 6px;
    padding: 4px;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
}

.core-cancel-link:hover,
.core-cancel-link:focus {
    color: #555;
    text-decoration: underline;
}

/* ── Processing page spinner ─────────────────────────────────────────── */

#core-spinner-container {
    min-height: 60vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

#core-spinner-container h2 {
    margin: 0;
}

#core-spinner-container label {
    margin: 0;
    opacity: 0.8;
}

#core-progress-bar {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
        -ms-flex-align: start;
            align-items: flex-start;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    gap: 0;
    max-width: 1000px;
    width: 100%;
    margin-top: 2rem;
}

.progress-step {
    min-width: 60px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 0.75rem;
    position: relative;
    -ms-flex-negative: 0;
        flex-shrink: 0;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 3px solid #e0e0e0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    position: relative;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    overflow: hidden;
}

.step-number {
    font-weight: 600;
    font-size: 1.25rem;
    color: #999;
    -webkit-transition: color 0.3s ease;
    transition: color 0.3s ease;
    position: relative;
    z-index: 2;
}

.step-spinner {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0;
    -webkit-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
}

.step-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.06), transparent);
    -webkit-animation: loading-sweep 1.5s ease-in-out infinite;
            animation: loading-sweep 1.5s ease-in-out infinite;
}

.step-label {
    font-size: 0.875rem;
    color: #666;
    text-align: center;
    max-width: 120px;
    font-weight: 500;
    -webkit-transition: color 0.3s ease;
    transition: color 0.3s ease;
}

.progress-connector {
    height: 3px;
    background: #e0e0e0;
    -webkit-box-flex: 1;
        -ms-flex: 1 1 0;
            flex: 1 1 0;
    min-width: 25px;
    max-width: 40px;
    margin-top: 22px;
    position: relative;
    overflow: hidden;
    -ms-flex-item-align: start;
        align-self: flex-start;
}

.progress-connector::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--draivi-color-1, #3498db);
    -webkit-transition: width 0.5s ease;
    transition: width 0.5s ease;
}

.progress-step.completed .step-circle {
    background: var(--draivi-color-1, #3498db);
    border-color: var(--draivi-color-1, #3498db);
}

.progress-step.completed .step-number {
    color: white;
}

.progress-step.completed .step-label {
    color: var(--draivi-color-1, #3498db);
}

.progress-step.completed + .progress-connector::after {
    width: 100%;
}

.progress-step.active .step-circle {
    border-color: var(--draivi-color-1, #3498db);
    background: white;
    -webkit-animation: step-active-pulse 1.4s ease-in-out infinite;
            animation: step-active-pulse 1.4s ease-in-out infinite;
}

.progress-step.active .step-number {
    color: var(--draivi-color-1, #3498db);
}

.progress-step.active .step-label {
    color: var(--draivi-color-1, #3498db);
}

.progress-step.active .step-spinner {
    opacity: 1;
}

@-webkit-keyframes step-active-pulse {
    0%, 100% {
        -webkit-box-shadow: 0 0 0 0 rgba(130, 130, 130, 0.3);
                box-shadow: 0 0 0 0 rgba(130, 130, 130, 0.3);
    }
    50% {
        -webkit-box-shadow: 0 0 0 8px rgba(130, 130, 130, 0);
                box-shadow: 0 0 0 8px rgba(130, 130, 130, 0);
    }
}

@keyframes step-active-pulse {
    0%, 100% {
        -webkit-box-shadow: 0 0 0 0 rgba(130, 130, 130, 0.3);
                box-shadow: 0 0 0 0 rgba(130, 130, 130, 0.3);
    }
    50% {
        -webkit-box-shadow: 0 0 0 8px rgba(130, 130, 130, 0);
                box-shadow: 0 0 0 8px rgba(130, 130, 130, 0);
    }
}

@-webkit-keyframes loading-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes loading-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ── Expedited container ─────────────────────────────────────────────── */

#core-expedited-container {
    min-height: 60vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    text-align: center;
    padding: 2rem;
    -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

#expedited-loading,
#expedited-complete {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 1.25rem;
}

#expedited-loading h2,
#expedited-complete h2,
#expedited-loading p,
#expedited-complete p {
    margin: 0;
}

#expedited-loading p,
#expedited-complete p {
    opacity: 0.8;
    font-size: 1rem;
}

.expedited-ring-wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    margin-top: 0.25rem;
}

.expedited-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, 0.08);
    border-top-color: var(--draivi-color-1, #3498db);
    -webkit-animation: expedited-spin 0.75s linear infinite;
            animation: expedited-spin 0.75s linear infinite;
}

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

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

@media (max-width: 400px) {
    #core-spinner-container,
    #core-expedited-container {
        -webkit-box-shadow: none;
                box-shadow: none;
        border-radius: 0;
    }
}

/* ── Identity card (verify / unlock forms) ───────────────────────────── */

.core-id-card {
    max-width: 480px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 12px;
    -webkit-box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
            box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

.core-id-card__accent {
    height: 6px;
    background: var(--draivi-color-1, #3498db);
}

.core-id-card__body {
    padding: 2rem 2rem 1.5rem;
}

.core-id-card__icon {
    display: block;
    color: var(--draivi-color-1, #3498db);
    margin-bottom: 0.875rem;
}

.core-id-card__title {
    margin: 0 0 0.375rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a1a1a;
}

.core-id-card__subtitle {
    margin: 0 0 1.375rem;
    font-size: 0.9375rem;
    color: #666;
    line-height: 1.55;
}

.core-id-card__email-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}

.core-id-card__email-label {
    font-size: 0.8125rem;
    color: #888;
}

.core-id-card__email-badge {
    display: inline-block;
    -ms-flex-item-align: start;
        align-self: flex-start;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 20px;
    font-family: monospace;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #333;
    word-break: break-all;
}

.core-id-card__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 0.375rem;
}

.core-id-card__input {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    border: 1.5px solid #ddd !important;
    border-radius: 8px !important;
    -webkit-box-sizing: border-box !important;
            box-sizing: border-box !important;
    -webkit-transition: border-color 0.2s;
    transition: border-color 0.2s;
    outline: none;
    margin-bottom: 0 !important;
    background-color: #fff !important;
    color: #1a1a1a !important;
    height: auto !important;
}

.core-id-card__input:focus {
    border-color: var(--draivi-color-1, #3498db) !important;
    outline: none !important;
}

.core-id-card__help {
    font-size: 0.8125rem;
    color: #888;
    margin: 0.375rem 0 1.25rem;
    line-height: 1.5;
}

.core-id-card__actions {
    margin-top: 1.25rem;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    gap: 0.5rem;
}

.core-id-card__error {
    margin-top: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #c00;
}

.core-id-card__error label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.core-id-card__footer {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
    padding: 0.875rem 2rem;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    font-size: 0.8125rem;
    color: #aaa;
    gap: 1rem;
}

.core-id-card__footer-date strong {
    color: #555;
    margin-left: 0.25rem;
}

.core-id-card__cancel {
    -ms-flex-negative: 0;
        flex-shrink: 0;
    color: #999;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.8125rem;
    padding: 0;
}

.core-id-card__cancel:hover,
.core-id-card__cancel:focus {
    color: #666;
    text-decoration: none;
}

.core-id-card__cancel:hover,
.core-id-card__cancel:focus {
    color: #555;
    text-decoration: underline;
}

/* ── Details tooltip (in core-id-card) ──────────────────────────────── */

.core-id-card__tooltip {
    display: inline-block;
    position: relative;
    cursor: help;
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
}

.core-id-card__tooltip summary {
    display: inline-block;
    list-style: none;
    line-height: 1;
}

.core-id-card__tooltip summary::-webkit-details-marker {
    display: none;
}

.core-id-card__tooltip summary::marker {
    content: "";
}

.core-id-card__tooltip summary::before {
    content: "?";
    display: inline-flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    border: 1px solid #bbb;
    border-radius: 50%;
    margin-left: 5px;
    vertical-align: middle;
}

.core-id-card__tooltip[open] summary::before {
    content: "\00d7";
    color: #555;
    border-color: #999;
}

.core-id-card__tooltip-popup {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 20;
    width: 220px;
    padding: 10px 12px;
    background: rgba(30, 30, 30, 0.93);
    color: #eee;
    font-size: 0.8125rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.5;
    border-radius: 6px;
    -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: default;
}

@media (max-width: 520px) {
    .core-id-card {
        margin: 0;
        border-radius: 0;
        -webkit-box-shadow: none;
                box-shadow: none;
    }

    .core-id-card__body {
        padding: 1.5rem 1.25rem 1rem;
    }

    .core-id-card__footer {
        padding: 0.875rem 1.25rem;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
        text-align: center;
    }
}
