/* ===================================
   FreshSMP Staff Portal - Setup Page
   Matches Login Page Design
   =================================== */

/* Uses same CSS variables as login page */
:root {
    --primary: #00d4ff;
    --primary-dark: #0096ff;
    --secondary: #1a3a52;
    --dark: #0d1f2d;
    --text-muted: #a0b5c7;
    --shadow-color: rgba(0, 212, 255, 0.3);
    --success: #00ff88;
    --error: #ff4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(180deg, #1a3a52 0%, #0d1f2d 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding: 20px;
}

/* Animated Background Particles - Same as login */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 150, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 212, 255, 0.05) 0%, transparent 50%);
    animation: backgroundShift 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* ============= WRAPPER ============= */
.setup-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 40px 20px;
}

/* ============= LOGO SECTION (SAME AS LOGIN) ============= */
.setup-logo-section {
    position: relative;
    z-index: 1;
    margin-bottom: 35px;
    animation: fadeIn 1s ease 0.3s both;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.setup-logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.setup-logo {
    width: 450px;
    height: auto;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 8px 20px rgba(0, 212, 255, 0.3));
    transition: all 0.4s ease;
    border: 4px solid rgba(0, 212, 255, 0.5);
    border-radius: 20px;
    padding: 20px;
    background: linear-gradient(145deg, rgba(13, 31, 45, 0.95) 0%, rgba(26, 58, 82, 0.9) 100%);
    box-shadow: 
        0 0 15px rgba(0, 212, 255, 0.25),
        0 0 30px rgba(0, 212, 255, 0.15),
        inset 0 0 15px rgba(0, 212, 255, 0.08);
}

.setup-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 10px 25px rgba(0, 212, 255, 0.4));
    border-color: rgba(0, 212, 255, 0.7);
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.35),
        0 0 40px rgba(0, 212, 255, 0.2),
        inset 0 0 20px rgba(0, 212, 255, 0.12);
}

.setup-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #00d4ff 0%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    line-height: 1.4;
}

/* ============= CARD (SAME DIMENSIONS AS LOGIN) ============= */
.setup-card {
    background: linear-gradient(145deg, rgba(13, 31, 45, 0.98) 0%, rgba(26, 58, 82, 0.95) 100%);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 25px;
    padding: 35px 30px;
    text-align: center;
    backdrop-filter: blur(30px);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 100px rgba(0, 212, 255, 0.15);
    animation: fadeInUp 0.8s ease, cardFloat 6s ease-in-out infinite;
    width: 100%;
    max-width: 550px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.setup-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 120px rgba(0, 212, 255, 0.25);
    border-color: rgba(0, 212, 255, 0.5);
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* Animated Background Gradient */
.setup-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle, 
        rgba(0, 212, 255, 0.12) 0%, 
        rgba(0, 150, 255, 0.08) 30%,
        transparent 70%
    );
    animation: rotate 25s linear infinite;
    z-index: 0;
}

/* Corner Accent Lines */
.setup-card::after {
    content: '';
    position: absolute;
    inset: 15px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 20px;
    pointer-events: none;
    z-index: 0;
}

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

/* ============= PROGRESS TRACKER ============= */
.setup-progress {
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
    animation: fadeIn 1s ease 0.4s both;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.2) 0%, rgba(0, 212, 255, 0.15) 100%);
    border: 2px solid rgba(0, 212, 255, 0.4);
    color: var(--primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.progress-step.completed .step-icon {
    background: linear-gradient(135deg, #0096ff 0%, #00d4ff 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.progress-step.active .step-icon {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.step-content span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-step.completed .step-content span {
    color: var(--primary);
}

.progress-step.active .step-content span {
    color: #ffffff;
}

.progress-line {
    width: 60px;
    height: 2px;
    background: rgba(0, 212, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.progress-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: shimmerLine 2s infinite;
}

@keyframes shimmerLine {
    to { left: 100%; }
}

/* ============= CONTENT ============= */
.setup-content {
    position: relative;
    z-index: 1;
    animation: fadeIn 1s ease 0.5s both;
}

.setup-header {
    margin-bottom: 25px;
}

.setup-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.setup-header h2 i {
    color: var(--primary);
}

.setup-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ============= ERROR ALERT ============= */
.setup-error {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.15) 0%, rgba(255, 68, 68, 0.1) 100%);
    border: 2px solid rgba(255, 68, 68, 0.4);
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: fadeInScale 0.4s ease;
    position: relative;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.error-icon {
    font-size: 1.5rem;
    color: var(--error);
}

.error-content {
    flex: 1;
    text-align: left;
}

.error-content > div:first-child {
    font-weight: 700;
    color: var(--error);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.error-content p {
    color: #ffffff;
    font-size: 0.85rem;
    line-height: 1.4;
}

.error-close {
    background: none;
    border: none;
    color: var(--error);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.error-close:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* ============= FORM ============= */
.setup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    text-align: left;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
}

.form-label i {
    color: var(--primary);
}

.form-label span:last-child {
    color: var(--error);
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
}

.setup-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(13, 31, 45, 0.6);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.setup-input:focus {
    border-color: var(--primary);
    background: rgba(13, 31, 45, 0.8);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.setup-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.setup-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-helper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.85rem;
}

.helper-text {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.helper-text i {
    color: var(--primary);
    font-size: 0.9rem;
}

.char-count {
    color: var(--text-muted);
    font-weight: 600;
}

.char-count.error {
    color: var(--error);
}

.char-count.success {
    color: var(--success);
}

/* ============= INFO BOX ============= */
.setup-info {
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.12) 0%, rgba(0, 212, 255, 0.08) 100%);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 15px 18px;
    display: flex;
    gap: 12px;
    text-align: left;
    transition: all 0.3s ease;
}

.setup-info:hover {
    border-color: rgba(0, 212, 255, 0.5);
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.15) 0%, rgba(0, 212, 255, 0.1) 100%);
}

.info-icon {
    font-size: 1.3rem;
    color: var(--primary);
    margin-top: 2px;
}

.info-content > div:first-child {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.info-content p {
    color: #ffffff;
    font-size: 0.88rem;
    line-height: 1.5;
}

.info-content strong {
    color: var(--primary);
}

/* ============= PREVIEW BOX ============= */
.skin-preview {
    background: rgba(13, 31, 45, 0.6);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 15px;
    animation: fadeInScale 0.4s ease;
}

.skin-preview > div:first-child {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.preview-content img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

.preview-content img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.5);
}

.preview-content > div:last-child {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ============= SUBMIT BUTTON ============= */
.setup-button {
    background: linear-gradient(135deg, #0096ff 0%, #00d4ff 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 25px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 12px 30px rgba(0, 150, 255, 0.4),
        0 0 0 0 rgba(0, 212, 255, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Smoother hover overlay using transform instead of size animation */
.setup-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.setup-button:hover:not(:disabled)::before {
    transform: translateX(0);
}

.setup-button:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 
        0 18px 45px rgba(0, 212, 255, 0.6),
        0 0 0 8px rgba(0, 212, 255, 0.1);
    background: linear-gradient(135deg, #00a6ff 0%, #00e4ff 100%);
}

.setup-button:active:not(:disabled) {
    transform: translateY(-2px) scale(0.98);
}

.setup-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.setup-button svg,
.setup-button i {
    color: white;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.setup-button:hover:not(:disabled) i.fa-arrow-right {
    transform: translateX(5px);
}

.button-spinner {
    border: 3px solid rgba(255,255,255,0.2);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 0.8s linear infinite;
}

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

/* ============= SECURITY NOTE ============= */
.setup-security {
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.85rem;
    padding: 10px 16px;
    background: rgba(0, 212, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
}

.setup-security:hover {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.4);
}

.setup-security i {
    font-size: 1rem;
}

.setup-security p {
    color: var(--text-muted);
    margin: 0;
}

/* ============= FOOTER ============= */
.setup-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
    animation: fadeIn 1s ease 1s both;
    width: 100%;
    max-width: 550px;
}

/* ============= ANIMATIONS ============= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .setup-wrapper {
        max-width: 90%;
    }

    .setup-card {
        padding: 30px 25px;
        border-radius: 20px;
    }

    .setup-logo {
        width: 350px;
        padding: 15px;
        border-width: 3px;
    }

    .setup-title {
        font-size: 1.8rem;
    }

    .setup-header h2 {
        font-size: 1.05rem;
    }

    .progress-steps {
        gap: 15px;
    }

    .progress-line {
        width: 40px;
    }

    .step-content span {
        font-size: 0.85rem;
    }

    .setup-input {
        font-size: 0.95rem;
        padding: 13px 16px;
    }

    .setup-button {
        font-size: 0.95rem;
        padding: 13px 22px;
    }
}

@media (max-width: 480px) {
    .setup-wrapper {
        max-width: 95%;
        padding: 30px 15px;
    }

    .setup-card {
        padding: 25px 20px;
        border-radius: 18px;
    }

    .setup-logo {
        width: 240px;
        padding: 12px;
        border-width: 3px;
    }

    .setup-title {
        font-size: 1.8rem;
    }

    .setup-header h2 {
        font-size: 1rem;
    }

    .progress-steps {
        flex-direction: column;
        gap: 15px;
    }

    .progress-line {
        width: 2px;
        height: 30px;
        transform: rotate(90deg);
    }

    .step-content {
        flex-direction: column;
        gap: 5px;
    }

    .setup-input {
        font-size: 0.9rem;
        padding: 12px 15px;
    }

    .input-helper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .setup-info {
        flex-direction: column;
        text-align: center;
    }

    .info-icon {
        font-size: 1.5rem;
    }

    .setup-button {
        font-size: 0.9rem;
        padding: 12px 20px;
    }

    .setup-security {
        font-size: 0.8rem;
        padding: 8px 14px;
        flex-direction: column;
        text-align: center;
    }

    .progress-ring {
        width: 80px;
        height: 80px;
    }

    .progress-percentage {
        font-size: 1.2rem;
    }
}

/* ============= ACCESSIBILITY ============= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .setup-card {
        border-width: 3px;
    }

    .setup-button {
        border: 2px solid #ffffff;
    }

    .setup-input {
        border-width: 3px;
    }
}