/* =====================================================
   Bio Link Generator — Install & Auth Shared CSS
   Clean, professional installer wizard styling
   ===================================================== */

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.12), 0 4px 6px -4px rgba(0,0,0,.1);
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    color: var(--gray-800);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ----- Layout ----- */
.install-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
}

.install-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 640px;
    overflow: hidden;
}

/* ----- Header ----- */
.install-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem 2rem 1.5rem;
    color: var(--white);
    text-align: center;
}

.install-logo {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.install-logo svg {
    width: 32px;
    height: 32px;
}

/* ----- Step Progress ----- */
.install-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: .5rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    position: relative;
    flex: 1;
    max-width: 100px;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;
    left: calc(50% + 14px);
    right: calc(-50% + 14px);
    height: 2px;
    background: rgba(255,255,255,.3);
}

.step-item.done::after,
.step-item.active::after {
    background: rgba(255,255,255,.7);
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
    color: rgba(255,255,255,.7);
    background: transparent;
    z-index: 1;
    position: relative;
}

.step-item.active .step-num {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
}

.step-item.done .step-num {
    background: rgba(255,255,255,.3);
    border-color: rgba(255,255,255,.7);
    color: var(--white);
}

.step-label {
    font-size: .65rem;
    color: rgba(255,255,255,.6);
    text-align: center;
    white-space: nowrap;
}

.step-item.active .step-label {
    color: var(--white);
    font-weight: 600;
}

/* ----- Body ----- */
.install-body {
    padding: 2rem;
}

.install-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: .375rem;
}

.install-subtitle {
    color: var(--gray-500);
    font-size: .9rem;
    margin-bottom: 1.5rem;
}

/* ----- Requirements Table ----- */
.req-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.req-table thead {
    background: var(--gray-50);
}

.req-table th {
    padding: .625rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--gray-200);
}

.req-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.req-table tr:last-child td {
    border-bottom: none;
}

.req-table tbody tr:hover {
    background: var(--gray-50);
}

.badge-pass {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: var(--success-light);
    color: var(--success);
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-fail {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: var(--danger-light);
    color: var(--danger);
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}

/* ----- Alerts ----- */
.alert {
    padding: .875rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: .625rem;
}

.alert-danger {
    background: var(--danger-light);
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert ul {
    margin: .25rem 0 0 1rem;
    list-style: disc;
}

/* ----- Form Elements ----- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: .375rem;
}

.form-hint {
    font-size: .75rem;
    color: var(--gray-500);
    margin-top: .25rem;
}

.form-control {
    width: 100%;
    padding: .625rem .875rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

/* Password toggle wrapper */
.input-group {
    position: relative;
}

.input-group .form-control {
    padding-right: 2.75rem;
}

.input-group-append {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0;
    display: flex;
    align-items: center;
}

.input-group-append:hover {
    color: var(--gray-600);
}

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: .4rem .875rem;
    font-size: .825rem;
}

.btn-block {
    width: 100%;
}

/* ----- Footer ----- */
.install-footer {
    text-align: center;
    padding: 1rem 2rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
}

.install-footer.centered {
    justify-content: center;
}

/* ----- Success State ----- */
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--success);
}

.success-icon svg {
    width: 40px;
    height: 40px;
}

/* ----- Connection test ----- */
#test-result {
    margin-top: .75rem;
    padding: .625rem .875rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    display: none;
}

#test-result.show { display: flex; gap: .5rem; align-items: center; }
#test-result.success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
#test-result.error   { background: var(--danger-light);  color: #b91c1c; border: 1px solid #fca5a5; }

/* ----- Spinner ----- */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

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

/* ----- Responsive ----- */
@media (max-width: 640px) {
    .install-card { border-radius: 16px; }
    .install-body { padding: 1.5rem; }
    .install-footer { padding: .875rem 1.5rem 1.25rem; }
    .step-label { display: none; }
}
