* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --isbank-blue: #003d82;
    --isbank-light-blue: #0066cc;
    --isbank-dark-blue: #002855;
    --success-green: #28a745;
    --text-dark: #1a1a1a;
    --text-gray: #666;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--isbank-dark-blue) 0%, var(--isbank-blue) 50%, var(--isbank-light-blue) 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: white;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
}

.header {
    background: white;
    padding: 20px;
    border-bottom: 3px solid var(--isbank-blue);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

.form-container {
    background: white;
    padding: 25px 20px;
    min-height: calc(100vh - 150px);
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 35px;
    padding: 0 20px;
}

.progress-step {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.4s ease;
    border: 3px solid var(--border-color);
    position: relative;
}

.progress-step.active {
    background: var(--isbank-blue);
    color: white;
    border-color: var(--isbank-blue);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 61, 130, 0.3);
}

.progress-step.completed {
    background: var(--success-green);
    color: transparent;
    border-color: var(--success-green);
}

.progress-step.completed::after {
    content: '✓';
    position: absolute;
    font-size: 24px;
    color: white;
}

.progress-line {
    width: 60px;
    height: 4px;
    background: var(--border-color);
    transition: all 0.4s ease;
}

.progress-line.completed {
    background: var(--success-green);
}

h2 {
    color: var(--isbank-blue);
    margin-bottom: 8px;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
}

.subtitle {
    color: var(--text-gray);
    margin-bottom: 30px;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 22px;
}

label {
    display: block;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

input[type="text"],
input[type="tel"],
select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-dark);
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="tel"]:focus,
select:focus {
    outline: none;
    border-color: var(--isbank-blue);
    box-shadow: 0 0 0 4px rgba(0, 61, 130, 0.1);
    background: #fafbfc;
}

input[type="text"]::placeholder,
input[type="tel"]::placeholder {
    color: #aaa;
}

select {
    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='%23003d82' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    cursor: pointer;
}

.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-weight: 500;
}

.radio-label:hover {
    border-color: var(--isbank-blue);
    background: #f8f9fa;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--isbank-blue);
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--isbank-blue);
    background: linear-gradient(135deg, #e8f2ff 0%, #f0f7ff 100%);
    box-shadow: 0 2px 8px rgba(0, 61, 130, 0.15);
}

.radio-label input[type="radio"]:checked + span {
    color: var(--isbank-blue);
    font-weight: 600;
}

.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

.btn-primary,
.btn-secondary {
    padding: 16px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-full {
    margin-top: 30px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--isbank-blue) 0%, var(--isbank-light-blue) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 61, 130, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 61, 130, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    margin-top: 30px;
}

.footer {
    background: var(--bg-light);
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-gray);
    font-size: 12px;
    line-height: 1.5;
}

/* Success Page Styles */
.success-icon {
    text-align: center;
    margin: 30px 0;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    color: var(--success-green);
    text-align: center;
    margin-bottom: 12px;
    font-size: 28px;
}

.success-subtitle {
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 30px;
    line-height: 1.6;
}

.application-details {
    background: var(--bg-light);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.detail-header {
    border-bottom: 2px solid var(--isbank-blue);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.detail-header h3 {
    color: var(--isbank-blue);
    font-size: 18px;
    font-weight: 700;
}

.detail-section {
    margin: 18px 0;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detail-section h4 {
    color: var(--isbank-blue);
    font-size: 15px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-gray);
    font-weight: 500;
    font-size: 13px;
}

.detail-value {
    color: var(--text-dark);
    font-weight: 600;
    text-align: right;
    font-size: 14px;
}

.detail-value.highlight {
    color: var(--isbank-blue);
    font-size: 20px;
    font-weight: 700;
}

.info-box {
    background: linear-gradient(135deg, #e8f2ff 0%, #f0f7ff 100%);
    border-left: 4px solid var(--isbank-light-blue);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box p {
    color: var(--text-dark);
    font-size: 13px;
    line-height: 1.6;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Input formatting helper */
.input-helper {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 6px;
    display: block;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
        max-width: 100%;
    }

    .header {
        padding: 16px;
    }

    .logo img {
        height: 45px;
    }

    .form-container {
        padding: 20px 16px;
        min-height: calc(100vh - 140px);
    }

    h2 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 13px;
    }

    .progress-bar {
        padding: 0 10px;
        margin-bottom: 30px;
    }

    .progress-step {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .progress-line {
        width: 40px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    input[type="text"],
    input[type="tel"],
    select {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 10px;
    }

    .radio-label {
        padding: 14px 10px;
        font-size: 14px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 15px 24px;
        font-size: 15px;
        border-radius: 10px;
    }

    .button-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .button-group .btn-secondary {
        order: 2;
    }

    .button-group .btn-primary {
        order: 1;
    }

    .application-details {
        padding: 16px;
        border-radius: 12px;
    }

    .detail-section {
        padding: 14px;
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 0;
    }

    .detail-value {
        text-align: left;
    }

    .success-title {
        font-size: 24px;
    }

    .footer {
        padding: 16px;
    }
}

@media (max-width: 380px) {
    .form-container {
        padding: 16px 12px;
    }

    h2 {
        font-size: 22px;
    }

    .progress-step {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .progress-line {
        width: 30px;
    }

    input[type="text"],
    input[type="tel"],
    select {
        padding: 12px 14px;
        font-size: 15px;
    }

    .radio-group {
        gap: 10px;
    }

    .radio-label {
        padding: 12px 8px;
        font-size: 13px;
    }
}

/* Smooth transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

input, select, button {
    transition: all 0.3s ease;
}

/* iOS specific fixes */
input[type="text"],
input[type="tel"],
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Prevent zoom on input focus for iOS */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="tel"],
    select {
        font-size: 16px !important;
    }
}
