/* ============================================
   AgentHire Cloud Dashboard — Apple Premium
   ============================================ */

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

:root {
    --bg: #000000;
    --bg-elevated: #0a0a0a;
    --bg-card: #111111;
    --bg-card-hover: #161616;
    --bg-input: #0a0a0a;
    --text: #f5f5f7;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    --accent-blue: #2997ff;
    --accent-purple: #bf5af2;
    --accent-gradient: linear-gradient(135deg, #2997ff, #bf5af2);
    --green: #30d158;
    --green-dim: rgba(48, 209, 88, 0.12);
    --red: #ff453a;
    --border: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --radius: 14px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: opacity var(--transition);
}
a:hover {
    opacity: 0.8;
}

/* --- Header --- */
header {
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
    transition: opacity var(--transition);
}
.logo:hover { opacity: 0.8; color: var(--text); }

.logo-icon {
    width: 24px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
}

.logo-icon::after {
    content: '';
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 2px;
    opacity: 0.9;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

.logo-cloud {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 2px;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-back-home {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--accent-blue);
    text-decoration: none;
    padding: 5px 12px 5px 8px;
    border-radius: 8px;
    transition: background var(--transition), opacity var(--transition);
}
.btn-back-home:hover {
    background: rgba(41, 151, 255, 0.1);
    opacity: 1;
}

.user-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* --- Step Indicator --- */
.step-indicator {
    padding: 40px 24px 16px;
    max-width: 420px;
    margin: 0 auto;
}

.step-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-tertiary);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.step.active .step-circle {
    border-color: transparent;
    background: var(--accent-gradient);
    color: #fff;
}

.step.completed .step-circle {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
    transition: color 0.5s ease;
}

.step.active .step-label { color: var(--text); }
.step.completed .step-label { color: var(--green); }

.step-line {
    flex: 1;
    height: 1px;
    background: var(--border);
    min-width: 56px;
    margin: 0 8px;
    margin-bottom: 28px;
    transition: background 0.6s ease;
    position: relative;
    overflow: hidden;
}

.step-line.filled {
    background: var(--green);
}
.step-line.filled::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(48, 209, 88, 0.4), transparent);
    animation: line-shimmer 1.2s ease-in-out;
}

@keyframes line-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 24px 80px;
}

.step-panel {
    display: none;
    width: 100%;
    max-width: 480px;
    animation: fadeSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.step-panel.active {
    display: block;
}

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

/* --- Card --- */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
}

.panel-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: none; /* Hide emoji icons */
}

.panel-card h1,
.panel-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    color: var(--text);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* --- Buttons --- */
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 340px;
    padding: 14px 28px;
    background: var(--text);
    color: #1d1d1f;
    border: none;
    border-radius: 980px;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-google:hover {
    background: #d1d1d6;
    transform: scale(1.01);
}
.btn-google:active {
    transform: scale(0.99);
}

.google-icon {
    flex-shrink: 0;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 28px;
    background: var(--text);
    color: #000;
    border: none;
    border-radius: 980px;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary:hover {
    background: #d1d1d6;
    transform: scale(1.01);
}
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.btn-deploy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    background: var(--text);
    color: #000;
    border: none;
    border-radius: 980px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}
.btn-deploy:hover {
    background: #d1d1d6;
    transform: scale(1.01);
}
.btn-deploy:active { transform: scale(0.99); }
.btn-deploy:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 980px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition);
}
.btn-icon:hover { color: var(--text); }

.btn-next {
    margin-top: 12px;
}

.btn-back {
    margin-top: 12px;
}

.btn-telegram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 28px;
    background: #2AABEE;
    color: #fff;
    border-radius: 980px;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 28px;
}
.btn-telegram:hover {
    color: #fff;
    opacity: 0.9;
    transform: scale(1.01);
}

/* --- Sign In Features --- */
.sign-in-features {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.feature-pill {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 980px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* --- Form --- */
.config-form {
    text-align: left;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.label-optional {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 4px;
}

.label-link {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent-blue);
}
.label-link:hover { opacity: 0.7; }

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: rgba(41, 151, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.1);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.input-with-icon {
    position: relative;
}
.input-with-icon input {
    padding-right: 48px;
}
.input-with-icon .btn-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.form-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}
.form-hint a {
    color: var(--accent-blue);
    font-weight: 500;
}

.model-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(48, 209, 88, 0.06);
    border: 1px solid rgba(48, 209, 88, 0.15);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.model-badge svg {
    flex-shrink: 0;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 14px 44px 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    transition: all var(--transition);
}
.select-wrapper select:focus {
    border-color: rgba(41, 151, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.1);
}
.select-wrapper select option {
    background: var(--bg-card);
    color: var(--text);
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

/* --- Review Grid (Step 3) --- */
.review-grid {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.review-item:last-child {
    border-bottom: none;
}

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

.review-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

/* --- Deploy Animation --- */
.deploy-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 28px;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--border);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    /* Use gradient via conic-gradient */
    background: conic-gradient(from 0deg, transparent 0%, transparent 25%, rgba(41, 151, 255, 0.3) 50%, rgba(191, 90, 242, 0.3) 75%, transparent 100%);
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}

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

.spinner-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
}

.spinner-icon::after {
    content: '';
    width: 24px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 8px;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Progress Bar */
.deploy-progress {
    margin-top: 36px;
}

.progress-bar {
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 500;
    transition: color 0.3s ease;
    letter-spacing: 0.01em;
}
.progress-step.active {
    color: var(--accent-blue);
}
.progress-step.done {
    color: var(--green);
}

/* --- Success --- */
.success-check {
    margin-bottom: 24px;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.success-check svg circle {
    stroke: var(--green);
}

.success-check svg path {
    stroke: var(--green);
}

.success-check svg path,
.success-check svg circle {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: draw 0.8s ease 0.3s forwards;
}

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

.success-details {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.detail-row:last-child { border-bottom: none; }

.detail-value {
    font-weight: 600;
    color: var(--text);
}

.status-live {
    color: var(--green) !important;
}

/* --- Error --- */
.error-text {
    color: var(--red);
}

/* --- Footer --- */
footer {
    padding: 20px 24px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border);
}
footer a {
    color: var(--text-tertiary);
    transition: color var(--transition);
}
footer a:hover {
    color: var(--text-secondary);
}

/* --- Utilities --- */
.hidden { display: none !important; }

/* --- Input validation styles --- */
.form-group input.error {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.1);
}

.form-group .error-msg {
    color: var(--red);
    font-size: 0.78rem;
    margin-top: 6px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    header { padding: 0 16px; }

    .step-indicator { padding: 32px 16px 8px; }
    .step-line { min-width: 36px; }
    .step-label { font-size: 0.62rem; }
    .step-circle { width: 28px; height: 28px; font-size: 0.72rem; }

    .main-content { padding: 24px 16px 64px; }

    .panel-card {
        padding: 36px 24px;
        border-radius: 16px;
    }
    .panel-card h1,
    .panel-card h2 { font-size: 1.45rem; }

    .sign-in-features { gap: 6px; }
    .feature-pill { font-size: 0.7rem; padding: 5px 10px; }

    .btn-google { padding: 12px 24px; font-size: 0.95rem; }
    .btn-deploy { padding: 14px 28px; font-size: 1rem; }

    .progress-steps {
        font-size: 0.62rem;
    }
}

@media (max-width: 380px) {
    .step-label { display: none; }
    .step-line { margin-bottom: 0; }
}

/* --- Ambient background glow (subtle) --- */
body::before {
    content: '';
    position: fixed;
    top: -300px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(41, 151, 255, 0.04) 0%, rgba(191, 90, 242, 0.02) 40%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}
