@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --focus-ring: rgba(79, 70, 229, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 400px),
                      radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.1), transparent 400px);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
}

.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #4F46E5, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.15rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05), 0 10px 20px -5px rgba(0, 0, 0, 0.02);
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fadeInUp 0.8s ease-out;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background-color: #F9FAFB;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.form-control::placeholder {
    color: #9CA3AF;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
    cursor: pointer;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
    background-color: var(--primary);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 0.5rem;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.qr-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 450px;
    background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(249,250,251,0.8) 100%);
}

.qr-placeholder {
    width: 250px;
    height: 250px;
    border: 2px dashed #D1D5DB;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    background-color: #F3F4F6;
    transition: all 0.3s ease;
}

.qr-image-container {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.qr-image-container.active {
    display: flex;
}

.qr-image {
    max-width: 100%;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
    background-color: #fff;
    padding: 0.5rem;
}

.btn-secondary {
    background-color: #FFFFFF;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* Loader */
.loader {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #FFFFFF;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: none;
}
.btn.loading .loader {
    display: inline-block;
}
.btn.loading span {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #B91C1C;
    background-color: #FEF2F2;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: none;
    border: 1px solid #FECACA;
    animation: fadeIn 0.3s ease;
}
.error-message.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Custom Select Dropdown with Bank Logos */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background-color: #F9FAFB;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
    min-height: 48px;
}

.custom-select-trigger:hover {
    border-color: #CBD5E1;
    background-color: #F1F5F9;
}

.custom-select-trigger.active {
    outline: none;
    border-color: var(--primary);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.trigger-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    flex: 1;
}

.trigger-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 0.375rem;
    padding: 2px;
    flex-shrink: 0;
}

.trigger-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.trigger-text {
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trigger-arrow {
    width: 1.25rem;
    height: 1.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.custom-select-trigger.active .trigger-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 999;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-search-wrapper {
    position: relative;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.35rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.dropdown-search-input {
    width: 100%;
    padding: 0.625rem 2.25rem 0.625rem 2.25rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: #F9FAFB;
    font-family: inherit;
    color: var(--text-main);
    transition: all 0.15s ease-in-out;
}

.dropdown-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.search-clear-btn {
    position: absolute;
    right: 1.35rem;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    display: none;
    line-height: 1;
}

.search-clear-btn:hover {
    color: var(--text-main);
}

.dropdown-options-list {
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.375rem;
    margin: 0;
}

/* Custom Scrollbar for dropdown */
.dropdown-options-list::-webkit-scrollbar {
    width: 6px;
}
.dropdown-options-list::-webkit-scrollbar-track {
    background: transparent;
}
.dropdown-options-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}
.dropdown-options-list::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.dropdown-option-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.dropdown-option-item:hover,
.dropdown-option-item.highlighted {
    background-color: #F1F5F9;
}

.dropdown-option-item.selected {
    background-color: #EEF2FF;
}

.dropdown-option-item.selected .option-short-name {
    color: var(--primary);
}

.option-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    padding: 3px;
    flex-shrink: 0;
}

.option-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.option-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.option-short-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
}

.option-full-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    margin-top: 0.125rem;
}

.no-results {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

