/**
 * Agency Registration Wizard - Midnight Champagne Theme
 * Matches global.css design system
 * Mobile-first, edge-to-edge layout
 */

/* ================================
   Global Resets
================================= */
* {
    box-sizing: border-box;
}

/* ================================
   Wizard Container - Midnight Champagne
================================= */
.wizard-page {
    min-height: 100vh;
    padding: 0;
    margin: 0;
    background: var(--bg-primary, #0d1117);
    color: var(--text-primary, #ffffff);
    position: relative;
}

/* Subtle background glow effect */
.wizard-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 400px;
    background: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#agencyWizard {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ================================
   Progress Dots - Midnight Theme
================================= */
.progress-dots {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.25rem 1rem;
    background: var(--bg-secondary, #1c1f26);
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.progress-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
    position: relative;
}

.progress-dot::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(100% + 0.75rem);
    width: 1.5rem;
    height: 2px;
    background: var(--border-medium, rgba(255, 255, 255, 0.15));
    transition: background 0.3s ease;
}

.progress-dot:last-child::after {
    display: none;
}

.progress-dot.completed::after {
    background: linear-gradient(135deg, #d4af37 0%, #f4e4a6 50%, #d4af37 100%);
}

.progress-dot.active,
.progress-dot.completed {
    opacity: 1;
}

.dot-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary, #161922);
    border: 2px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted, #6b6b7b);
}

.progress-dot.active .dot-circle {
    background: linear-gradient(135deg, #d4af37 0%, #f4e4a6 50%, #d4af37 100%);
    border-color: var(--champagne, #d4af37);
    color: var(--text-on-gold, #1a1a1a);
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
}

.progress-dot.completed .dot-circle {
    background: var(--champagne, #d4af37);
    border-color: var(--champagne, #d4af37);
    color: var(--text-on-gold, #1a1a1a);
}

.progress-dot.completed .dot-circle::before {
    content: '✓';
    position: absolute;
    font-size: 0.9rem;
}

.dot-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted, #6b6b7b);
    text-align: center;
    max-width: 90px;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.progress-dot.active .dot-label {
    color: var(--text-primary, #ffffff);
    font-weight: 600;
}

.progress-dot:hover:not(.active) {
    opacity: 0.75;
}

/* ================================
   Wizard Cards - Dark Theme
================================= */
.wizard-wrap {
    position: relative;
    padding: 0;
}

.wizard-card {
    background: var(--bg-secondary, #1c1f26);
    padding: 1.5rem 1rem;
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: calc(100vh - 80px);
}

.wizard-card.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    padding: 0 0.5rem;
    background: linear-gradient(135deg, var(--text-primary, #ffffff) 0%, var(--champagne, #d4af37) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wizard-sub {
    color: var(--text-secondary, #a8a8b8);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    padding: 0 0.5rem;
}

/* ================================
   Section Groups - Midnight Theme
================================= */
.section-group {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.section-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.section-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.875rem;
    color: var(--text-primary, #ffffff);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.section-label::before {
    content: '';
    width: 3px;
    height: 18px;
    background: linear-gradient(180deg, #d4af37 0%, #b8941f 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* ================================
   Form Elements - Dark Theme
================================= */
.form-row {
    display: grid;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
}

.form-row:has(.field:nth-child(2)) {
    grid-template-columns: 1fr 1fr;
}

.field {
    display: flex;
    flex-direction: column;
}

.field label {
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-primary, #ffffff);
    font-size: 0.85rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-tertiary, #161922);
    color: var(--text-primary, #ffffff);
    font-family: inherit;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-muted, #6b6b7b);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--champagne, #d4af37);
    background: var(--bg-elevated, #252932);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.field input:hover:not(:focus),
.field select:hover:not(:focus),
.field textarea:hover:not(:focus) {
    border-color: var(--border-strong, rgba(255, 255, 255, 0.25));
    background: var(--bg-elevated, #252932);
}

.field input.error,
.field select.error {
    border-color: var(--error, #ef4444);
    background: rgba(239, 68, 68, 0.1);
}

.field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Select styling */
.field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ================================
   Services Grid - Dark Theme
================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.625rem;
    padding: 0 0.5rem;
}

.services-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-tertiary, #161922);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary, #a8a8b8);
}

.services-grid label:hover {
    border-color: var(--champagne, #d4af37);
    background: var(--bg-elevated, #252932);
    color: var(--text-primary, #ffffff);
    transform: translateY(-1px);
}

.services-grid input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--champagne, #d4af37);
    flex-shrink: 0;
}

.services-grid label:has(input:checked) {
    border-color: var(--champagne, #d4af37);
    background: linear-gradient(135deg, #1c1f26 0%, #161922 100%);
    color: var(--text-primary, #ffffff);
    box-shadow: 0 0 0 1px var(--champagne, #d4af37), 0 4px 20px rgba(212, 175, 55, 0.25);
}

/* ================================
   Days Grid - Dark Theme
================================= */
.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.days-grid label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.625rem 0.375rem;
    border: 1.5px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-tertiary, #161922);
    font-weight: 500;
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-secondary, #a8a8b8);
}

.days-grid label:hover {
    border-color: var(--champagne, #d4af37);
    background: var(--bg-elevated, #252932);
    color: var(--text-primary, #ffffff);
}

.days-grid input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--champagne, #d4af37);
}

.days-grid label:has(input:checked) {
    border-color: var(--champagne, #d4af37);
    background: linear-gradient(135deg, #1c1f26 0%, #161922 100%);
    color: var(--text-primary, #ffffff);
    box-shadow: 0 0 0 1px var(--champagne, #d4af37);
}

/* ================================
   File Upload - Dark Theme
================================= */
.file-box {
    margin-bottom: 1.25rem;
    padding: 0 0.5rem;
}

.file-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text-primary, #ffffff);
    font-size: 0.85rem;
}

.file-box input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.875rem;
    border: 2px dashed var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-tertiary, #161922);
    color: var(--text-secondary, #a8a8b8);
    font-size: 0.85rem;
}

.file-box input[type="file"]:hover {
    border-color: var(--champagne, #d4af37);
    background: var(--bg-elevated, #252932);
    color: var(--text-primary, #ffffff);
}

.file-box input[type="file"]:focus {
    outline: none;
    border-color: var(--champagne, #d4af37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.preview-grid {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.875rem;
    flex-wrap: wrap;
}

.preview-grid img {
    border: 2px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: 6px;
    padding: 3px;
    background: var(--bg-tertiary, #161922);
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
}

/* ================================
   Terms & Notices - Dark Theme
================================= */
.terms-row {
    padding: 0 0.5rem;
}

.terms-row label {
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
    cursor: pointer;
    padding: 0.875rem;
    border: 1.5px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-tertiary, #161922);
    font-weight: 400;
    line-height: 1.5;
    font-size: 0.875rem;
    color: var(--text-secondary, #a8a8b8);
}

.terms-row label:hover {
    border-color: var(--champagne, #d4af37);
    background: var(--bg-elevated, #252932);
    color: var(--text-primary, #ffffff);
}

.terms-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.125rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--champagne, #d4af37);
}

.terms-row label:has(input:checked) {
    border-color: var(--champagne, #d4af37);
    background: linear-gradient(135deg, #1c1f26 0%, #161922 100%);
    color: var(--text-primary, #ffffff);
}

.notice-box {
    background: linear-gradient(135deg, #1c1f26 0%, #161922 100%);
    border: 1.5px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    margin: 1.25rem 0.5rem 0;
}

.notice-box svg {
    flex-shrink: 0;
    color: var(--champagne, #d4af37);
    margin-top: 0.125rem;
    width: 18px;
    height: 18px;
}

.notice-box p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #a8a8b8);
    line-height: 1.5;
}

/* ================================
   Buttons & Actions - Midnight Theme
================================= */
.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.875rem;
    margin-top: 1.75rem;
    padding: 1.25rem 1rem 1rem;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    background: var(--bg-secondary, #1c1f26);
    position: sticky;
    bottom: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.btn {
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-gold {
    background: linear-gradient(135deg, #d4af37 0%, #f4e4a6 50%, #d4af37 100%);
    color: var(--text-on-gold, #1a1a1a);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
    border: 1px solid transparent;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #e6c05f 0%, #ffeed6 50%, #e6c05f 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.35);
}

.btn-gold:active {
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary, #a8a8b8);
    border: 1.5px solid var(--border-medium, rgba(255, 255, 255, 0.15));
}

.btn-ghost:hover {
    border-color: var(--champagne, #d4af37);
    color: var(--champagne, #d4af37);
    background: rgba(255, 255, 255, 0.05);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ================================
   Validation Message - Dark Theme
================================= */
.validation-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1.5px solid var(--error, #ef4444);
    border-radius: 6px;
    padding: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0 0.5rem 1.25rem;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-message.fade-out {
    animation: fadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.validation-message svg {
    color: var(--error, #ef4444);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.validation-message span {
    color: var(--error, #ef4444);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ================================
   Loading Spinner
================================= */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================
   Hints
================================= */
.hint {
    font-size: 0.8rem;
    color: var(--text-muted, #6b6b7b);
    margin-top: 0.375rem;
    line-height: 1.4;
}

/* ================================
   Custom Scrollbar - Midnight Theme
================================= */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary, #161922);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong, rgba(255, 255, 255, 0.25));
    border-radius: 6px;
    border: 3px solid var(--bg-tertiary, #161922);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--champagne, #d4af37);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong, rgba(255, 255, 255, 0.25)) var(--bg-tertiary, #161922);
}

/* ================================
   Selection
================================= */
::selection {
    background: rgba(212, 175, 55, 0.3);
    color: var(--text-primary, #ffffff);
}

::-moz-selection {
    background: rgba(212, 175, 55, 0.3);
    color: var(--text-primary, #ffffff);
}

/* ================================
   Responsive Design - Mobile First
================================= */
@media (max-width: 768px) {
    .progress-dots {
        gap: 1rem;
        padding: 1rem 0.75rem;
    }

    .progress-dot::after {
        display: none;
    }

    .dot-label {
        font-size: 0.65rem;
        max-width: 70px;
    }

    .dot-circle {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .wizard-card {
        padding: 1.25rem 0.75rem;
    }

    .wizard-title {
        font-size: 1.5rem;
        padding: 0 0.25rem;
    }

    .wizard-sub {
        padding: 0 0.25rem;
    }

    .form-row {
        padding: 0 0.25rem;
    }

    .form-row:has(.field:nth-child(2)) {
        grid-template-columns: 1fr;
    }

    .section-label {
        padding: 0 0.25rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        padding: 0 0.25rem;
    }

    .days-grid {
        grid-template-columns: repeat(4, 1fr);
        padding: 0 0.25rem;
    }

    .file-box {
        padding: 0 0.25rem;
    }

    .terms-row {
        padding: 0 0.25rem;
    }

    .notice-box {
        margin: 1.25rem 0.25rem 0;
    }

    .step-actions {
        flex-direction: column-reverse;
        padding: 1rem 0.75rem 0.875rem;
    }

    .btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }

    .validation-message {
        margin: 0 0.25rem 1rem;
    }
}

@media (max-width: 480px) {
    .wizard-card {
        padding: 1rem 0.5rem;
    }

    .wizard-title {
        font-size: 1.25rem;
    }

    .section-label {
        font-size: 0.95rem;
    }

    .days-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.375rem;
    }

    .days-grid label {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .services-grid label {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .step-actions {
        padding: 0.875rem 0.5rem 0.75rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ================================
   Desktop Optimization
================================= */
@media (min-width: 1024px) {
    .wizard-card {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem 2.5rem;
        border-radius: 16px;
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    }

    .wizard-title {
        padding: 0;
    }

    .wizard-sub {
        padding: 0;
    }

    .form-row {
        padding: 0;
    }

    .section-label {
        padding: 0;
    }

    .services-grid {
        padding: 0;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .days-grid {
        padding: 0;
    }

    .file-box {
        padding: 0;
    }

    .terms-row {
        padding: 0;
    }

    .notice-box {
        margin: 1.5rem 0 0;
    }

    .validation-message {
        margin: 0 0 1.5rem;
    }

    .step-actions {
        padding: 1.5rem 0 0;
        background: transparent;
        position: relative;
        margin-top: 2rem;
    }
}

@media (min-width: 1440px) {
    .wizard-card {
        max-width: 1400px;
        padding: 2.5rem 3rem;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* ================================
   Accessibility
================================= */
.btn:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
    outline: 2px solid var(--champagne, #d4af37);
    outline-offset: 2px;
}

.progress-dot:focus-visible {
    outline: 2px solid var(--champagne, #d4af37);
    outline-offset: 4px;
    border-radius: 50%;
}

/* ================================
   Reduced Motion
================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================
   Print Styles
================================= */
@media print {
    .progress-dots,
    .step-actions {
        display: none;
    }

    .wizard-card {
        box-shadow: none;
        border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    }

    .wizard-page {
        background: white;
    }

    .wizard-page::before {
        display: none;
    }
}