/**
 * Phone Heavens Repair Appointment System
 * Modern Multi-Step Form Styles
 */

:root {
    --ph-primary: #2563eb;
    --ph-primary-dark: #1d4ed8;
    --ph-primary-light: #eff6ff;
    --ph-success: #10b981;
    --ph-success-light: #d1fae5;
    --ph-text: #1f2937;
    --ph-text-light: #6b7280;
    --ph-border: #e5e7eb;
    --ph-bg: #ffffff;
    --ph-bg-alt: #f9fafb;
    --ph-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --ph-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
}

#phone-heavens-container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ph-text);
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.ph-header {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 10px;
}

.ph-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--ph-text);
}

.ph-header p {
    font-size: 16px;
    color: var(--ph-text-light);
    margin: 0;
}

.ph-progress-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--ph-bg);
    border-radius: 12px;
    box-shadow: var(--ph-shadow);
    flex-wrap: wrap;
}

.ph-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 20px;
    cursor: pointer;
}

.ph-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 60%;
    width: calc(100% - 20px);
    height: 2px;
    background: var(--ph-border);
    z-index: 0;
}

.ph-step.completed:not(:last-child)::after {
    background: var(--ph-success);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ph-bg-alt);
    border: 2px solid var(--ph-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--ph-text-light);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

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

.ph-step.completed .step-number {
    background: var(--ph-success);
    border-color: var(--ph-success);
    color: white;
}

.step-label {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ph-text-light);
    transition: color 0.3s ease;
}

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

.ph-step.completed .step-label {
    color: var(--ph-success);
}

#phone-heavens-form {
    background: var(--ph-bg);
    border-radius: 12px;
    box-shadow: var(--ph-shadow);
    padding: 30px;
}

#phone-heavens-form.success-state {
    grid-column: 1 / -1;
    max-width: 600px;
    margin: 0 auto;
}

.ph-form-step {
    display: none;
}

.ph-form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.step-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: var(--ph-text);
}

.step-subtitle {
    font-size: 14px;
    color: var(--ph-text-light);
    margin: -15px 0 20px 0;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.device-card {
    cursor: pointer;
}

.device-card input {
    display: none;
}

.device-card .card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid var(--ph-border);
    border-radius: 12px;
    background: var(--ph-bg);
    transition: all 0.2s ease;
}

.device-card:hover .card-inner {
    border-color: #d1d5db;
    box-shadow: var(--ph-shadow);
}

.device-card input:checked + .card-inner {
    border-color: var(--ph-primary);
    background: var(--ph-primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.device-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.device-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.device-name {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: var(--ph-text);
}

.model-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.model-card {
    cursor: pointer;
}

.model-card input {
    display: none;
}

.model-card .card-inner {
    padding: 15px;
    border: 2px solid var(--ph-border);
    border-radius: 8px;
    background: var(--ph-bg);
    transition: all 0.2s ease;
    text-align: center;
}

.model-card:hover .card-inner {
    border-color: #d1d5db;
    background: var(--ph-bg-alt);
}

.model-card input:checked + .card-inner {
    border-color: var(--ph-primary);
    background: var(--ph-primary-light);
}

.model-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ph-text);
}

.issue-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.issue-card {
    cursor: pointer;
}

.issue-card input {
    display: none;
}

.issue-card .card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 12px;
    border: 2px solid var(--ph-border);
    border-radius: 10px;
    background: var(--ph-bg);
    transition: all 0.2s ease;
}

.issue-card:hover .card-inner {
    border-color: #d1d5db;
    box-shadow: var(--ph-shadow);
}

.issue-card input:checked + .card-inner {
    border-color: var(--ph-primary);
    background: var(--ph-primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.issue-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    color: var(--ph-primary);
}

.issue-icon svg {
    width: 100%;
    height: 100%;
}

.issue-name {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    color: var(--ph-text);
}

.form-fields {
    margin-bottom: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ph-text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid var(--ph-border);
    border-radius: 8px;
    background: var(--ph-bg);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group 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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--ph-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group.half {
    flex: 1;
}

.schedule-info {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: var(--ph-primary-light);
    border-radius: 10px;
    margin-top: 10px;
}

.schedule-info .info-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--ph-primary);
}

.schedule-info .info-icon svg {
    width: 100%;
    height: 100%;
}

.schedule-info .info-text {
    font-size: 14px;
    color: var(--ph-text);
    line-height: 1.5;
}

.confirmation-summary {
    background: var(--ph-bg-alt);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--ph-border);
    flex-wrap: wrap;
    gap: 10px;
}

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

.summary-item.highlight {
    background: var(--ph-primary-light);
    margin: 0 -25px;
    padding: 12px 25px;
    border-bottom: none;
}

.summary-label {
    font-weight: 500;
    color: var(--ph-text-light);
    flex-shrink: 0;
}

.summary-value {
    font-weight: 600;
    color: var(--ph-text);
    text-align: right;
    word-break: break-word;
}

.summary-divider {
    height: 1px;
    background: var(--ph-border);
    margin: 15px 0;
}

.warranty-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--ph-success-light);
    border-radius: 8px;
    color: #065f46;
    font-weight: 500;
    margin-bottom: 20px;
}

.warranty-icon {
    font-size: 20px;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn-back,
.btn-next,
.btn-submit {
    padding: 14px 30px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back {
    background: var(--ph-bg-alt);
    color: var(--ph-text);
    border: 1px solid var(--ph-border);
}

.btn-back:hover {
    background: #f3f4f6;
}

.btn-next,
.btn-submit {
    background: var(--ph-primary);
    color: white;
    flex: 1;
    min-width: 150px;
}

.btn-next:hover:not(:disabled),
.btn-submit:hover:not(:disabled) {
    background: var(--ph-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--ph-shadow-lg);
}

.btn-next:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.btn-submit {
    background: var(--ph-success);
}

.btn-submit:hover:not(:disabled) {
    background: #059669;
}

.success-message {
    text-align: center;
    padding: 50px 30px;
    background: var(--ph-bg);
    border-radius: 12px;
    box-shadow: var(--ph-shadow);
    max-width: 100%;
    box-sizing: border-box;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--ph-success-light);
    color: var(--ph-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.success-message h3 {
    font-size: 24px;
    margin: 0 0 15px;
    color: var(--ph-text);
}

.success-message p {
    font-size: 16px;
    color: var(--ph-text-light);
    margin: 0 0 25px;
    line-height: 1.6;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.btn-new {
    padding: 14px 30px;
    background: var(--ph-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    width: auto;
    max-width: 100%;
}

.btn-new:hover {
    background: var(--ph-primary-dark);
    transform: translateY(-1px);
}

.ph-sidebar {
    background: var(--ph-bg);
    border-radius: 12px;
    box-shadow: var(--ph-shadow);
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.ph-sidebar h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px;
    color: var(--ph-text);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--ph-border);
}

.sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 10px;
}

.sidebar-item:last-of-type {
    border-bottom: none;
}

.sidebar-label {
    font-size: 13px;
    color: var(--ph-text-light);
    flex-shrink: 0;
}

.sidebar-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--ph-text);
    text-align: right;
    word-break: break-word;
}

.sidebar-divider {
    height: 1px;
    background: var(--ph-border);
    margin: 15px 0;
}

.sidebar-item.warranty {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ph-success-light);
    padding: 12px 15px;
    border-radius: 8px;
    color: #065f46;
    font-weight: 500;
    font-size: 14px;
}

.warranty-badge {
    font-size: 16px;
}

.sidebar-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--ph-border);
}

.sidebar-section h5 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 15px;
    color: var(--ph-text);
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefits-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--ph-text-light);
}

.benefits-list .check {
    color: var(--ph-success);
    font-weight: 600;
}

@media (max-width: 900px) {
    #phone-heavens-container {
        grid-template-columns: 1fr;
    }

    .ph-sidebar {
        display: none;
    }

    .device-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .issue-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    #phone-heavens-form.success-state {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .ph-progress-bar {
        padding: 15px 10px;
    }

    .ph-step {
        padding: 0 10px;
    }

    .step-label {
        font-size: 10px;
    }

    .device-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .model-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .issue-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    #phone-heavens-form {
        padding: 20px;
    }

    .success-message {
        padding: 40px 20px;
    }

    .success-message h3 {
        font-size: 20px;
    }

    .success-message p {
        font-size: 14px;
    }

    .summary-item.highlight {
        margin: 0 -20px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    #phone-heavens-container {
        padding: 0 15px;
        margin: 20px auto;
    }

    .ph-header h2 {
        font-size: 22px;
    }

    .ph-header p {
        font-size: 14px;
    }

    .ph-step:not(:last-child)::after {
        display: none;
    }

    .step-label {
        display: none;
    }

    .ph-step {
        padding: 0 8px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .device-grid,
    .issue-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .model-grid {
        grid-template-columns: 1fr;
    }

    .step-navigation {
        flex-direction: column;
    }

    .btn-back {
        order: 2;
    }

    .btn-next,
    .btn-submit,
    .btn-back {
        width: 100%;
        text-align: center;
    }

    .success-message {
        padding: 30px 15px;
    }

    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .success-message h3 {
        font-size: 18px;
    }

    .success-message p {
        font-size: 13px;
    }

    .btn-new {
        width: 100%;
        padding: 14px 20px;
    }

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

    .summary-item {
        flex-direction: column;
        gap: 5px;
    }

    .summary-value {
        text-align: left;
    }

    .summary-item.highlight {
        margin: 0 -15px;
        padding: 12px 15px;
    }
}

.model-grid::-webkit-scrollbar {
    width: 6px;
}

.model-grid::-webkit-scrollbar-track {
    background: var(--ph-bg-alt);
    border-radius: 3px;
}

.model-grid::-webkit-scrollbar-thumb {
    background: var(--ph-border);
    border-radius: 3px;
}

.model-grid::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}
