/**
 * Registration Loading UI Styles
 * Beautiful, modern loading overlay with progress steps
 */

.hi-registration-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hi-loading-content {
    max-width: 600px;
    width: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(148, 163, 184, 0.1);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hi-loading-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.hi-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

.hi-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.hi-spinner-ring:nth-child(1) {
    border-top-color: #3b82f6;
    animation-delay: -0.45s;
}

.hi-spinner-ring:nth-child(2) {
    border-top-color: #8b5cf6;
    animation-delay: -0.3s;
}

.hi-spinner-ring:nth-child(3) {
    border-top-color: #06b6d4;
    animation-delay: -0.15s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.hi-loading-messages {
    text-align: center;
}

.hi-loading-title {
    font-size: 24px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 32px 0;
    letter-spacing: -0.02em;
}

.hi-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    text-align: left;
}

.hi-progress-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.4;
}

.hi-progress-step.active {
    opacity: 1;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
    animation: pulse 2s ease-in-out infinite;
}

.hi-progress-step.completed {
    opacity: 0.7;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.25);
    }
}

.hi-step-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.hi-progress-step.active .hi-step-icon {
    background: rgba(59, 130, 246, 0.2);
    animation: iconPulse 1.5s ease-in-out infinite;
}

.hi-progress-step.completed .hi-step-icon {
    background: rgba(16, 185, 129, 0.2);
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.hi-step-icon svg {
    color: #94a3b8;
    transition: color 0.3s ease;
}

.hi-progress-step.active .hi-step-icon svg {
    color: #3b82f6;
}

.hi-progress-step.completed .hi-step-icon svg {
    color: #10b981;
}

.hi-step-content {
    flex: 1;
}

.hi-step-label {
    font-size: 15px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.hi-progress-step.active .hi-step-label {
    color: #f1f5f9;
}

.hi-progress-step.completed .hi-step-label {
    color: #94a3b8;
}

.hi-step-description {
    font-size: 13px;
    color: #64748b;
    transition: color 0.3s ease;
}

.hi-progress-step.active .hi-step-description {
    color: #94a3b8;
}

.hi-loading-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 24px;
}

.hi-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
    background-size: 200% 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 2s linear infinite;
    width: 0%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.hi-loading-note {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.hi-upload {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hi-upload.has-file label {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.08);
}

.hi-upload .hi-resume-clear {
    align-self: flex-end;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hi-upload .hi-resume-clear:hover {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
    color: #f87171;
}

.hi-resume-preview {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    animation: fadeIn 0.2s ease-out;
}

.hi-resume-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.hi-resume-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
}

.hi-resume-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hi-resume-name {
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hi-resume-size {
    font-size: 12px;
    color: #94a3b8;
}

.hi-resume-remove {
    background: rgba(148, 163, 184, 0.15);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    transition: background 0.2s ease, color 0.2s ease;
}

.hi-resume-remove:hover {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

@media (max-width: 480px) {
    .hi-resume-preview {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hi-resume-chip {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .hi-resume-remove {
        align-self: flex-end;
    }
}

@media (max-width: 640px) {
    .hi-loading-content {
        padding: 32px 24px;
    }

    .hi-loading-title {
        font-size: 20px;
        margin-bottom: 24px;
    }

    .hi-spinner {
        width: 60px;
        height: 60px;
    }

    .hi-progress-step {
        padding: 12px;
        gap: 12px;
    }

    .hi-step-icon {
        width: 36px;
        height: 36px;
    }

    .hi-step-icon svg {
        width: 18px;
        height: 18px;
    }

    .hi-step-label {
        font-size: 14px;
    }

    .hi-step-description {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .hi-registration-loading {
        padding: 16px;
    }

    .hi-loading-content {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .hi-loading-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .hi-progress-steps {
        gap: 12px;
        margin-bottom: 24px;
    }

    .hi-progress-step {
        padding: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hi-registration-loading,
    .hi-loading-content,
    .hi-progress-step,
    .hi-step-icon,
    .hi-progress-bar-fill {
        animation: none;
        transition: none;
    }

    .hi-spinner-ring {
        animation: none;
    }
}

/* ── Corner-Case Modal ──────────────────────────────────────────────────── */

.hi-corner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

.hi-corner-panel {
    max-width: 480px;
    width: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 20px;
    padding: 40px 36px 32px;
    text-align: center;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
    animation: slideUp 0.3s ease-out;
}

.hi-corner-icon-wrap {
    margin-bottom: 20px;
}

.hi-corner-icon-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
}

.hi-corner-icon--info {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.hi-corner-icon--warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.hi-corner-icon--pending {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
}

.hi-corner-title {
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.hi-corner-body {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.65;
    margin: 0 0 28px;
}

.hi-corner-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.hi-corner-btn {
    display: block;
    width: 100%;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
    border: none;
}

.hi-corner-btn:active {
    transform: scale(0.98);
}

.hi-corner-btn--primary {
    background: #3b82f6;
    color: #fff;
}

.hi-corner-btn--primary:hover {
    background: #2563eb;
}

.hi-corner-btn--secondary {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.hi-corner-btn--secondary:hover {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.35);
}

.hi-corner-dismiss {
    background: none;
    border: none;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s ease;
}

.hi-corner-dismiss:hover {
    color: #94a3b8;
}

/* Highlight pulse on the admin checkbox card when "Register as Company Admin" is chosen.
   Two-class selector (.hi-auth-checkbox-card.hi-corner-highlight) beats the single-class
   base rule in style.css — no !important needed. */
@keyframes hi-corner-highlight-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.55); }
    50%  { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.hi-auth-checkbox-card.hi-corner-highlight {
    border-color: rgba(59, 130, 246, 0.6);
    animation: hi-corner-highlight-pulse 0.8s ease-out 2;
}

@media (max-width: 480px) {
    .hi-corner-panel {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }

    .hi-corner-title {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hi-corner-overlay,
    .hi-corner-panel,
    .hi-corner-btn,
    .hi-corner-dismiss,
    .hi-auth-checkbox-card.hi-corner-highlight {
        animation: none;
        transition: none;
    }
}
