/* ============================================================
   IDENTITY PAGE — ZKP Digital Identity Center
   Deep navy dark theme · Glassmorphism · Crypto aesthetic
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
    /* Backgrounds */
    --bg-deepest:   #050810;
    --bg-deep:      #0a0e1a;
    --bg-card:      rgba(15, 20, 40, 0.55);
    --bg-card-hover:rgba(20, 28, 58, 0.65);

    /* Glass */
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur:   20px;

    /* Text */
    --text-primary:   #e8ecf4;
    --text-secondary: #8892a8;
    --text-muted:     #505a70;

    /* Accent – purple / blue gradient */
    --accent-start: #7c3aed;
    --accent-end:   #3b82f6;
    --accent-mid:   #6366f1;

    /* Semantic colours */
    --color-private:   #ef4444;
    --color-private-bg:rgba(239, 68, 68, 0.08);
    --color-private-border:rgba(239, 68, 68, 0.25);

    --color-public:    #3b82f6;
    --color-public-bg: rgba(59, 130, 246, 0.08);
    --color-public-border:rgba(59, 130, 246, 0.25);

    --color-commit:    #22c55e;
    --color-commit-bg: rgba(34, 197, 94, 0.08);
    --color-commit-border:rgba(34, 197, 94, 0.25);

    --color-success:   #22c55e;
    --color-warning:   #f59e0b;

    /* Radii & shadows */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35);

    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* ---------- Particle Canvas ---------- */
#particleCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* ---------- Floating Orbs ---------- */
.floating-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-start), transparent 70%);
    top: -10%;
    right: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-end), transparent 70%);
    bottom: -10%;
    left: -10%;
    animation-delay: -7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--color-commit), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(30px, -40px) scale(1.08); }
    50%      { transform: translate(-20px, 25px) scale(0.95); }
    75%      { transform: translate(15px, 35px) scale(1.05); }
}

/* ---------- Main Container ---------- */
.zkp-container {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}

/* ---------- Glass Card ---------- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* ---------- Header ---------- */
.zkp-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s var(--ease-out-expo) both;
}

.header-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.icon-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    font-size: 32px;
    color: #fff;
    position: relative;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.35),
                0 0 80px rgba(99, 102, 241, 0.15);
    animation: iconPulse 3s ease-in-out infinite;
}

.icon-ring::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.3);
    animation: ringRotate 8s linear infinite;
}

.icon-ring::after {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 1px dashed rgba(99, 102, 241, 0.15);
    animation: ringRotate 12s linear infinite reverse;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.35), 0 0 80px rgba(99, 102, 241, 0.15); }
    50%      { box-shadow: 0 0 60px rgba(99, 102, 241, 0.5),  0 0 120px rgba(99, 102, 241, 0.2); }
}

@keyframes ringRotate {
    to { transform: rotate(360deg); }
}

.header-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.header-subtitle {
    margin-bottom: 0;
}

.subtitle-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-mid);
    letter-spacing: 0.02em;
}

.header-line {
    width: 60px;
    height: 3px;
    margin: 24px auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
}

/* ---------- Form Card ---------- */
.form-card {
    padding: 36px 32px;
    animation: fadeInUp 0.8s var(--ease-out-expo) 0.15s both;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.card-header-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--accent-mid);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---------- Form Elements ---------- */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group label i {
    font-size: 0.75rem;
    margin-right: 4px;
    opacity: 0.7;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: rgba(10, 14, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    z-index: 1;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    border-color: var(--accent-mid);
    background: rgba(15, 20, 45, 0.8);
}

.input-wrapper input:focus ~ .input-glow {
    opacity: 1;
}

.input-wrapper input:focus + .input-glow,
.input-wrapper input:focus ~ .input-glow {
    opacity: 1;
}

.input-wrapper:has(input:focus) .input-icon {
    color: var(--accent-mid);
}

.input-glow {
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-md) + 2px);
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    opacity: 0;
    z-index: 0;
    transition: opacity 0.3s ease;
    filter: blur(6px);
}

.error-msg {
    display: none;
    font-size: 0.78rem;
    color: var(--color-private);
    margin-top: 6px;
    padding-left: 4px;
    animation: shakeX 0.4s ease;
}

.form-group.has-error .error-msg {
    display: block;
}

.form-group.has-error .input-wrapper input {
    border-color: var(--color-private);
}

/* ---------- Submit Button ---------- */
.btn-submit {
    width: 100%;
    padding: 16px 24px;
    margin-top: 12px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: #fff;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4),
                0 0 60px rgba(99, 102, 241, 0.15);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-content,
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-loader {
    display: none;
}

.btn-submit.loading .btn-content { display: none; }
.btn-submit.loading .btn-loader  { display: flex; }

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-submit:hover .btn-glow {
    opacity: 1;
}

/* ---------- Result Panel ---------- */
.result-panel {
    display: none;
    margin-top: 40px;
}

.result-panel.visible {
    display: block;
}

/* ---------- Success Banner ---------- */
.success-banner {
    text-align: center;
    padding: 40px 32px;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s var(--ease-out-expo) both;
    border-color: rgba(34, 197, 94, 0.15);
}

.success-icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.success-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    animation: successPop 0.5s var(--ease-out-expo) 0.3s both;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.35);
}

.success-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(34, 197, 94, 0.3);
    z-index: 1;
}

.ring-1 { animation: ringPulse 2s ease-out 0.5s infinite; }
.ring-2 { animation: ringPulse 2s ease-out 1s infinite; }
.ring-3 { animation: ringPulse 2s ease-out 1.5s infinite; }

@keyframes ringPulse {
    0%   { transform: scale(1);   opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}

@keyframes successPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1);    opacity: 1; }
}

.success-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #22c55e, #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.success-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    max-width: 440px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.identity-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.identity-badge i {
    color: var(--accent-mid);
}

.badge-separator {
    color: var(--text-muted);
}

/* ---------- Crypto Cards ---------- */
.crypto-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.crypto-card {
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.crypto-card:hover {
    transform: translateY(-2px);
}

/* Staggered entrance */
#cardPrivate { animation: fadeInUp 0.5s var(--ease-out-expo) 0.2s both; }
#cardPublic  { animation: fadeInUp 0.5s var(--ease-out-expo) 0.35s both; }
#cardCommit  { animation: fadeInUp 0.5s var(--ease-out-expo) 0.5s both; }

/* Per-card colour accents */
.card-private { border-color: var(--color-private-border); }
.card-private:hover { box-shadow: 0 8px 32px rgba(239, 68, 68, 0.12); }

.card-public { border-color: var(--color-public-border); }
.card-public:hover { box-shadow: 0 8px 32px rgba(59, 130, 246, 0.12); }

.card-commit { border-color: var(--color-commit-border); }
.card-commit:hover { box-shadow: 0 8px 32px rgba(34, 197, 94, 0.12); }

.crypto-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.crypto-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.private-icon { background: var(--color-private-bg); color: var(--color-private); }
.public-icon  { background: var(--color-public-bg);  color: var(--color-public); }
.commit-icon  { background: var(--color-commit-bg);  color: var(--color-commit); }

.crypto-label h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.crypto-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.tag-private { background: var(--color-private-bg); color: var(--color-private); }
.tag-public  { background: var(--color-public-bg);  color: var(--color-public); }
.tag-commit  { background: var(--color-commit-bg);  color: var(--color-commit); }

.eye-toggle {
    margin-left: auto;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.eye-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--color-private-border);
}

/* Crypto Value */
.crypto-value-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(5, 8, 16, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.crypto-value {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--text-secondary);
    word-break: break-all;
    transition: filter 0.3s ease;
    min-width: 0;
}

.crypto-value.blurred {
    filter: blur(6px);
    user-select: none;
}

.copy-btn {
    min-width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.copy-btn.copied {
    color: var(--color-commit);
    border-color: var(--color-commit-border);
}

/* Private key warning */
.crypto-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--color-private);
    line-height: 1.5;
}

.crypto-warning i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* ---------- Info Box ---------- */
.info-box {
    padding: 28px;
    margin-bottom: 24px;
    border-color: rgba(99, 102, 241, 0.12);
    animation: fadeInUp 0.5s var(--ease-out-expo) 0.65s both;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--accent-mid);
}

.info-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.info-header i {
    font-size: 1.1rem;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.step-number {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-mid);
    flex-shrink: 0;
}

.info-step p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-step p strong {
    color: var(--text-primary);
}

/* ---------- CTA Button ---------- */
.cta-wrapper {
    text-align: center;
    animation: fadeInUp 0.5s var(--ease-out-expo) 0.8s both;
}

.btn-cta {
    display: inline-flex;
    text-decoration: none;
    padding: 18px 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #e040fb, #7c3aed, #3b82f6);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(124, 58, 237, 0.35),
                0 0 80px rgba(99, 102, 241, 0.15);
}

.btn-cta:active {
    transform: translateY(-1px);
}

.btn-cta-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.btn-cta-content .fa-arrow-right {
    transition: transform 0.3s ease;
}

.btn-cta:hover .fa-arrow-right {
    transform: translateX(4px);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deepest);
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .zkp-container {
        padding: 32px 14px 60px;
    }

    .form-card {
        padding: 24px 18px;
    }

    .success-banner {
        padding: 28px 18px;
    }

    .crypto-card {
        padding: 18px;
    }

    .info-box {
        padding: 20px;
    }

    .btn-cta {
        padding: 16px 24px;
        font-size: 0.92rem;
    }

    .icon-ring {
        width: 64px;
        height: 64px;
        font-size: 26px;
    }

    .success-circle {
        width: 64px;
        height: 64px;
        font-size: 26px;
    }

    .floating-orb { opacity: 0.12; }
    .orb-1 { width: 300px; height: 300px; }
    .orb-2 { width: 250px; height: 250px; }
    .orb-3 { width: 200px; height: 200px; }
}

@media (max-width: 380px) {
    .header-title {
        font-size: 1.5rem;
    }

    .subtitle-badge {
        font-size: 0.75rem;
        padding: 5px 14px;
    }

    .identity-badge {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .badge-separator {
        display: none;
    }

    .crypto-value {
        font-size: 0.65rem;
    }
}
