/* OrbIT CardMan - Auth v2 Success/Status Styles
   Success icons, error states, progress bar for status v2 pages */

/* ============================
   SUCCESS CONTENT
   ============================ */
.v2-success-content {
    text-align: center;
    padding: 20px 10px 8px;
    position: relative;
    z-index: 1;
    animation: v2ContentFadeIn 0.6s ease-out 0.3s both;
}

@keyframes v2ContentFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.v2-success-icon {
    color: var(--v2-accent);
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

/* ============================
   ANIMATED CHECKMARK SVG
   ============================ */
.icon-ring {
    opacity: 0.15;
    animation: iconRingPulse 3s ease-in-out 1.5s infinite;
}

@keyframes iconRingPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.35; }
}

.icon-bg {
    opacity: 0;
    animation: iconFadeIn 0.5s ease-out 0.2s forwards;
}

@keyframes iconFadeIn {
    to { opacity: 1; }
}

@keyframes iconDraw {
    to { stroke-dashoffset: 0; }
}

.icon-circle-draw {
    stroke-dasharray: 189;
    stroke-dashoffset: 189;
    animation: iconDraw 0.8s ease-out 0.2s forwards;
}

.icon-check-draw {
    stroke-dasharray: 44;
    stroke-dashoffset: 44;
    animation: iconDraw 0.5s ease-out 0.9s forwards;
}

.icon-sparkle {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: iconSparkle 2.5s ease-out var(--delay, 1s) infinite;
}

@keyframes iconSparkle {
    0%   { opacity: 0; transform: scale(0); }
    15%  { opacity: 1; transform: scale(1.3); }
    30%  { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0; transform: scale(0); }
}

/* ============================
   ANIMATED X SVG (Error)
   ============================ */
.icon-x-draw {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: iconDraw 0.4s ease-out 0.6s forwards;
}

/* ============================
   SUCCESS/ERROR TEXT
   ============================ */
.v2-success-text h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    color: var(--v2-accent);
    margin: 16px 0 8px;
    animation: v2TextReveal 0.5s ease-out 1.0s both;
}

.v2-success-text p {
    color: var(--v2-text-sub);
    font-size: 0.9rem;
    animation: v2TextReveal 0.5s ease-out 1.2s both;
}

@keyframes v2TextReveal {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Error variant */
.v2-error-content {
    text-align: center;
    padding: 20px 10px 8px;
    position: relative;
    z-index: 1;
    animation: v2ContentFadeIn 0.6s ease-out 0.3s both;
}

.v2-error-icon {
    color: #ef4444;
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.v2-error-content .v2-success-text h2 {
    color: #ef4444;
}

/* ============================
   PROGRESS BAR
   ============================ */
.v2-progress-wrap {
    margin-top: 28px;
    position: relative;
    z-index: 1;
    animation: v2TextReveal 0.5s ease-out 1.4s both;
}

.v2-progress-track {
    width: 100%;
    height: 4px;
    background: var(--v2-progress-track);
    border-radius: 2px;
    overflow: hidden;
}

.v2-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--v2-accent), var(--v2-accent-alt));
    border-radius: 2px;
    animation: v2ProgressFill 2.5s ease-in-out 1.0s forwards;
    box-shadow: 0 0 8px rgba(var(--v2-accent-rgb), 0.3);
}

@keyframes v2ProgressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ============================
   DOT RIPPLE (Success pages)
   ============================ */
.v2-dots-ripple .v2-card-dots span {
    color: rgba(var(--v2-accent-rgb), 0.15);
    animation: v2DotRipple 2s ease-out forwards;
}

.v2-dots-ripple .v2-card-dots span:nth-child(1) { animation-delay: 0.4s; }
.v2-dots-ripple .v2-card-dots span:nth-child(2) { animation-delay: 0.6s; }
.v2-dots-ripple .v2-card-dots span:nth-child(3) { animation-delay: 0.8s; }
.v2-dots-ripple .v2-card-dots span:nth-child(4) { animation-delay: 1.0s; }

@keyframes v2DotRipple {
    0% { color: rgba(var(--v2-accent-rgb), 0.15); }
    30% { color: rgba(var(--v2-accent-rgb), 0.4); }
    100% { color: rgba(var(--v2-accent-rgb), 0.18); }
}

/* ============================
   ORBITING SPHERE ANIMATION
   ============================ */
.v2-orbit-status {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 4px;
}

.v2-orbit-status .orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Orbital ring */
.v2-orbit-status .orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110px;
    height: 110px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1.5px solid var(--orbit-color, var(--v2-accent));
    opacity: 0;
    animation: orbitRingReveal 0.8s ease-out 0.3s forwards;
}

@keyframes orbitRingReveal {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    100% { opacity: 0.2; transform: translate(-50%, -50%) scale(1); }
}

/* The orbiting sphere */
.v2-orbit-status .orbit-sphere {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--orbit-color-light, var(--v2-accent-alt)), var(--orbit-color, var(--v2-accent)));
    box-shadow: 0 0 10px var(--orbit-color, var(--v2-accent)), 0 0 20px rgba(var(--orbit-rgb, var(--v2-accent-rgb)), 0.3);
    z-index: 3;
    opacity: 0;
    animation: orbitSphereReveal 0.4s ease-out 1.2s forwards, orbitRotate 3s linear 1.2s infinite;
    offset-path: ellipse(52px 40px at 60px 60px);
    offset-rotate: 0deg;
}

/* Trail dots */
.v2-orbit-status .orbit-trail {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--orbit-color, var(--v2-accent));
    z-index: 1;
    opacity: 0;
}

.orbit-trail:nth-child(3) {
    animation: orbitSphereReveal 0.4s ease-out 1.4s forwards, orbitRotate 3s linear 1.4s infinite;
    offset-path: ellipse(52px 40px at 60px 60px);
    offset-rotate: 0deg;
    width: 4px; height: 4px;
}
.orbit-trail:nth-child(4) {
    animation: orbitSphereReveal 0.4s ease-out 1.55s forwards, orbitRotate 3s linear 1.55s infinite;
    offset-path: ellipse(52px 40px at 60px 60px);
    offset-rotate: 0deg;
    width: 3px; height: 3px;
}
.orbit-trail:nth-child(5) {
    animation: orbitSphereReveal 0.4s ease-out 1.7s forwards, orbitRotate 3s linear 1.7s infinite;
    offset-path: ellipse(52px 40px at 60px 60px);
    offset-rotate: 0deg;
    width: 2px; height: 2px;
}

@keyframes orbitSphereReveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes orbitRotate {
    from { offset-distance: 0%; }
    to { offset-distance: 100%; }
}

/* Corona glow on the center icon */
.v2-orbit-status .orbit-corona {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--orbit-rgb, var(--v2-accent-rgb)), 0.15) 0%, transparent 70%);
    animation: orbitCorona 2.5s ease-in-out 1s infinite;
    z-index: 0;
}

@keyframes orbitCorona {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

/* Success variant (green orbit) */
.v2-orbit-success {
    --orbit-color: #22c55e;
    --orbit-color-light: #4ade80;
    --orbit-rgb: 34, 197, 94;
}

/* Error variant (red orbit) */
.v2-orbit-error {
    --orbit-color: #ef4444;
    --orbit-color-light: #fca5a5;
    --orbit-rgb: 239, 68, 68;
}

/* Accent variant (theme color orbit) */
.v2-orbit-accent {
    --orbit-color: var(--v2-accent);
    --orbit-color-light: var(--v2-accent-alt);
    --orbit-rgb: var(--v2-accent-rgb);
}

/* ============================
   ACTION BUTTON
   ============================ */
.v2-action-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--v2-accent) 0%, var(--v2-accent-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(var(--v2-accent-rgb), 0.25);
    transition: all 0.3s ease;
    animation: v2TextReveal 0.5s ease-out 1.4s both;
}

.v2-action-btn:hover {
    box-shadow: 0 8px 32px rgba(var(--v2-accent-rgb), 0.4);
    transform: translateY(-2px);
    text-decoration: none;
    color: #fff;
}

/* Accent action button variant (success pages) */
.v2-action-btn-success {
    background: linear-gradient(135deg, var(--v2-accent) 0%, var(--v2-accent-dark) 100%);
    box-shadow: 0 4px 20px rgba(var(--v2-accent-rgb), 0.25);
}

.v2-action-btn-success:hover {
    box-shadow: 0 8px 32px rgba(var(--v2-accent-rgb), 0.4);
}

/* ============================
   SUCCESS PAGE AMBIENT (dual glow)
   ============================ */
.v2-ambient-success {
    background: radial-gradient(circle, rgba(var(--v2-accent-rgb), 0.08) 0%, rgba(var(--v2-accent-rgb), 0.04) 40%, transparent 70%);
}

/* ============================
   RESPONSIVE (Success-specific)
   ============================ */
@media (max-width: 560px) {
    .v2-success-content,
    .v2-error-content {
        padding: 16px 6px 4px;
    }

    .v2-success-text h2 {
        font-size: 1.2rem;
    }
}

/* ============================
   REDUCED MOTION (Success-specific)
   ============================ */
@media (prefers-reduced-motion: reduce) {
    .v2-success-content,
    .v2-error-content { animation: none; opacity: 1; transform: none; }
    .v2-success-text h2,
    .v2-success-text p,
    .v2-progress-wrap { animation: none; opacity: 1; transform: none; }
    .v2-progress-bar { animation: none; width: 100%; }
    .icon-ring, .icon-sparkle { animation: none; }
    .icon-sparkle { opacity: 0.4; }
    .icon-ring { opacity: 0.2; }
    .icon-circle-draw, .icon-check-draw, .icon-x-draw { animation: none; stroke-dashoffset: 0; }
    .icon-bg { animation: none; opacity: 1; }
    .v2-dots-ripple .v2-card-dots span { animation: none; }
    .v2-action-btn { animation: none; opacity: 1; transform: none; }
    .orbit-sphere, .orbit-trail, .orbit-ring, .orbit-corona { animation: none; opacity: 0.5; }
    .orbit-sphere { offset-distance: 0%; opacity: 1; }
    .orbit-ring { opacity: 0.2; transform: translate(-50%, -50%) scale(1); }
}
