/**
 * OTP Checkout System - Modern Design
 * Compact, Clean, Professional, Mobile-Friendly
 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --border-radius: 10px;
    --spacing: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

/* Main Container */
.otp-checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    min-height: 100vh;
}

/* Progress Bar */
.checkout-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
    background: white;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.progress-step .step-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
    transition: var(--transition);
}

.progress-step.active .step-circle {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: scale(1.05);
}

.progress-step .step-label {
    font-size: 1.1rem;
    color: var(--gray-600);
    font-weight: 500;
}

.progress-step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--gray-200);
    margin: 0 0.25rem;
}

/* Checkout Content */
.checkout-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
}

.checkout-form-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Form Styling */
.step-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

.step-header h4 {
    margin: 0 0 0.2rem 0;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--gray-900);
}

.step-header p {
    margin: 0;
    font-size: 1.15rem;
    color: var(--gray-600);
}

.form-group {
    margin-bottom: 0.9rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group .optional {
    color: var(--gray-600);
    font-weight: normal;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1.2rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-group .form-text {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.05rem;
    color: var(--gray-600);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.7rem;
}

.form-row:has(> .form-group:only-child) {
    grid-template-columns: 1fr;
}

.form-row:has(> .form-group:nth-child(2):last-child) {
    grid-template-columns: 1fr 1fr;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--gray-200);
    color: var(--gray-500);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, var(--success) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    padding: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.btn-link:disabled {
    color: var(--gray-300);
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1.1rem;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.7rem;
    margin-top: 1.25rem;
}

/* Outlets */
.outlet-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.outlet-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.outlet-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.outlet-item.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.02) 100%);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.outlet-radio {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.outlet-radio input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.outlet-info {
    flex: 1;
    min-width: 0;
}

.outlet-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.2rem;
    font-size: 1.25rem;
}

.outlet-address {
    font-size: 1.05rem;
    color: var(--gray-600);
}

.outlet-city {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

/* OTP Specific */
.otp-info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, rgba(6, 182, 212, 0.02) 100%);
    border-left: 4px solid var(--info);
    padding: 0.7rem 0.95rem;
    margin-bottom: 0.9rem;
    border-radius: 6px;
    font-size: 1.2rem;
    color: var(--gray-700);
}

.otp-code-wrapper {
    margin-bottom: 0.85rem;
}

.otp-code-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 0.2rem;
    text-align: center;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    transition: var(--transition);
    background: white;
}

.otp-code-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    outline: none;
}

.otp-timer {
    text-align: center;
    margin-bottom: 0.85rem;
    font-size: 1.15rem;
    color: var(--gray-600);
}

.otp-timer strong {
    color: var(--danger);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 0.7rem 0.95rem;
    margin-bottom: 0.9rem;
    border-radius: 7px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.15rem;
    border-left: 4px solid;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border-left-color: var(--success);
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left-color: var(--danger);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left-color: var(--warning);
}

.alert-info {
    background: #cffafe;
    color: #164e63;
    border-left-color: var(--info);
}

.alert-icon {
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Sidebar Summary */
.checkout-summary {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.summary-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.summary-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 1rem;
    font-weight: 600;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-items {
    padding: 1rem;
    max-height: 220px;
    overflow-y: auto;
}

.summary-items::-webkit-scrollbar {
    width: 4px;
}

.summary-items::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.summary-items::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.summary-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 0.5rem;
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.item-name {
    color: var(--gray-700);
    font-weight: 500;
}

.item-qty {
    color: var(--gray-500);
    font-size: 0.8rem;
}

.item-price {
    color: var(--primary);
    font-weight: 600;
    text-align: right;
}

.summary-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 0.65rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0;
    font-size: 1.1rem;
    color: var(--gray-700);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding: 0.9rem 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--success);
    border-top: 2px solid var(--primary);
}

/* Step Animations */
.checkout-step {
    display: none;
    animation: fadeIn 0.35s ease-out;
}

.checkout-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Spinner Animation */
.fa-spin {
    animation: spin 1s linear infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .otp-checkout-container {
        padding: 0.75rem;
    }

    .checkout-progress {
        margin-bottom: 1.25rem;
        padding: 1rem;
        gap: 0.35rem;
    }

    .progress-step .step-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    .progress-step .step-label {
        font-size: 0.85rem;
    }

    .progress-line {
        margin: 0 0.2rem;
    }

    .checkout-content {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .checkout-form-section {
        padding: 1.2rem;
    }

    .checkout-summary {
        position: relative;
        top: 0;
    }

    .summary-card {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .button-group {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .btn {
        width: 100%;
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
    }

    .otp-code-input {
        font-size: 1.4rem;
        letter-spacing: 0.15rem;
        padding: 0.8rem;
    }

    .form-control {
        padding: 0.6rem 0.75rem;
        font-size: 1rem;
    }

    .summary-items {
        max-height: 150px;
    }

    .form-group {
        margin-bottom: 0.8rem;
    }

    .step-header h4 {
        font-size: 1.3rem;
    }

    .step-header p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .otp-checkout-container {
        padding: 0.5rem;
        background: white;
    }

    .checkout-progress {
        margin-bottom: 1rem;
        padding: 0.9rem;
        gap: 0.25rem;
    }

    .progress-step .step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .progress-step .step-label {
        font-size: 0.7rem;
    }

    .progress-line {
        margin: 0 0.15rem;
    }

    .checkout-form-section {
        padding: 1rem;
        border-radius: 8px;
    }

    .step-header h4 {
        font-size: 1.2rem;
    }

    .step-header p {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 0.7rem;
    }

    .btn {
        padding: 0.6rem 0.9rem;
        font-size: 0.95rem;
    }

    .button-group {
        margin-top: 1rem;
        gap: 0.5rem;
    }

    .otp-code-input {
        font-size: 1.3rem;
        letter-spacing: 0.1rem;
        padding: 0.7rem;
    }

    .summary-header {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    .summary-items {
        padding: 0.8rem;
        max-height: 140px;
    }

    .summary-row {
        font-size: 0.9rem;
        padding: 0.35rem 0;
    }

    .form-row {
        gap: 0.5rem;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .otp-checkout-container {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    }

    .checkout-progress {
        background: #1f2937;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .checkout-form-section {
        background: #1f2937;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .form-control {
        background: #374151;
        color: #f3f4f6;
        border-color: #4b5563;
    }

    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    }

    .form-control::placeholder {
        color: #6b7280;
    }

    .step-header {
        border-bottom-color: #374151;
    }

    .step-header h4 {
        color: #f3f4f6;
    }

    .form-group label {
        color: #e5e7eb;
    }

    .outlet-item {
        background: #2d3748;
        border-color: #4b5563;
    }

    .outlet-item:hover {
        background: #374151;
        border-color: var(--primary-light);
    }

    .outlet-item.selected {
        background: rgba(37, 99, 235, 0.15);
        border-color: var(--primary);
    }

    .outlet-name {
        color: #f3f4f6;
    }

    .outlet-address,
    .outlet-city {
        color: #9ca3af;
    }

    .summary-card {
        background: #1f2937;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    .summary-items {
        border-top: 1px solid #374151;
    }

    .summary-item {
        border-bottom-color: #374151;
    }

    .summary-divider {
        background: #374151;
    }

    .summary-row,
    .item-name,
    .otp-info {
        color: #d1d5db;
    }

    .btn-outline {
        background: transparent;
        border-color: #4b5563;
    }

    .btn-outline:hover {
        background: #374151;
    }

    .otp-code-input {
        background: #374151;
        color: #f3f4f6;
        border-color: #4b5563;
    }

    .alert-success {
        background: rgba(16, 185, 129, 0.15);
        color: #86efac;
        border-left-color: var(--success);
    }

    .alert-danger {
        background: rgba(239, 68, 68, 0.15);
        color: #fca5a5;
        border-left-color: var(--danger);
    }

    .alert-warning {
        background: rgba(245, 158, 11, 0.15);
        color: #fcd34d;
        border-left-color: var(--warning);
    }

    .alert-info {
        background: rgba(6, 182, 212, 0.15);
        color: #67e8f9;
        border-left-color: var(--info);
    }
}

/* Print Styles */
@media print {
    .checkout-progress,
    .button-group,
    .btn,
    .checkout-summary {
        display: none;
    }

    .checkout-content {
        grid-template-columns: 1fr;
    }

    .otp-checkout-container {
        background: white;
        box-shadow: none;
    }
}
