/* ============================================================
   CrowdPeru — Login page styles
   (Dark premium, paleta morado/índigo)
   ============================================================ */

:root {
    --cp-purple: #a855f7;
    --cp-indigo: #6366f1;
    --cp-accent: #c4b5fd;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background:
        radial-gradient(circle at 20% 20%, rgba(168, 85, 247, 0.25), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.25), transparent 50%),
        linear-gradient(135deg, #0a0a0f 0%, #14111f 50%, #0a0a0f 100%);
    min-height: 100vh;
    color: #e5e7eb;
    overflow-x: hidden;
}

/* Burbujas decorativas animadas */
.cp-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}
.cp-blob.b1 { width: 320px; height: 320px; top: -80px; left: -80px; background: #a855f7; animation: cp-float-a 14s ease-in-out infinite; }
.cp-blob.b2 { width: 360px; height: 360px; bottom: -100px; right: -100px; background: #6366f1; animation: cp-float-b 18s ease-in-out infinite; }
@keyframes cp-float-a {
    0%,100% { transform: translate(0,0) scale(1); }
    50%     { transform: translate(40px, 30px) scale(1.1); }
}
@keyframes cp-float-b {
    0%,100% { transform: translate(0,0) scale(1); }
    50%     { transform: translate(-50px,-30px) scale(1.05); }
}

.cp-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    position: relative;
}

.cp-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    background: rgba(20, 17, 31, 0.65);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 20px;
    padding: 2.25rem 2rem 2rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04) inset;
    animation: cp-card-in 0.55s cubic-bezier(.22,.95,.36,1);
}
@keyframes cp-card-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.cp-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--cp-purple), var(--cp-indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(168, 85, 247, 0.45);
    overflow: hidden;
}
.cp-logo img { width: 100%; height: 100%; object-fit: cover; }
.cp-logo .bi { font-size: 2rem; color: #fff; }

h1.cp-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 .35rem;
    background: linear-gradient(135deg, #fff, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
p.cp-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0 0 1.5rem;
}

.cp-field { position: relative; margin-bottom: 1rem; }
.cp-field > i.bi-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.05rem;
    pointer-events: none;
    transition: color .2s;
}
.cp-input {
    width: 100%;
    padding: 0.85rem 2.75rem 0.85rem 2.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.cp-input::placeholder { color: #6b7280; }
.cp-input:focus {
    border-color: var(--cp-purple);
    background: rgba(168, 85, 247, 0.07);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}
.cp-field:focus-within > i.bi-prefix { color: var(--cp-accent); }
.cp-toggle-eye {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
    font-size: 1.05rem;
    user-select: none;
    transition: color .2s;
}
.cp-toggle-eye:hover { color: var(--cp-accent); }

.cp-btn {
    width: 100%;
    padding: 0.9rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cp-purple), var(--cp-indigo));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    transition: transform .15s, box-shadow .2s, opacity .2s;
    margin-top: .25rem;
}
.cp-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(168, 85, 247, 0.5); }
.cp-btn:active:not(:disabled) { transform: translateY(0); }
.cp-btn:disabled { opacity: .7; cursor: wait; }
.cp-btn .spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cp-spin .8s linear infinite;
    display: none;
}
.cp-btn.loading .spinner { display: inline-block; }
.cp-btn.loading .bi-box-arrow-in-right { display: none; }
@keyframes cp-spin { to { transform: rotate(360deg); } }

.cp-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.875rem;
    padding: .5rem .85rem;
    border-radius: 10px;
    transition: color .2s, background .2s;
}
.cp-back:hover { color: var(--cp-accent); background: rgba(168, 85, 247, 0.08); }
.cp-back-wrap { text-align: center; margin-top: 1.25rem; }

.cp-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    padding: .75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 1.25rem;
    animation: cp-shake .4s;
}
@keyframes cp-shake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-6px); }
    75%     { transform: translateX(6px); }
}

.cp-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 1.25rem;
}
.cp-footer a { color: var(--cp-accent); text-decoration: none; }
