/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #494949;
    background: #f5f7fa;
    position: relative;
    overflow-x: hidden;
}

/* Demo Warning Banner */
.demo-warning {
    background: #ff6b35;
    color: white;
    text-align: center;
    padding: 3px 12px;
    font-weight: 600;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
    font-size: 13px;
    line-height: 1.2;
}

/* Screen management */
.screen {
    display: none;
    position: fixed;
    top: 21px; /* Account for warning banner height */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: #f5f7fa;
    overflow-y: auto;
    margin-top: -1px; /* Eliminate any potential gap */
}

.screen.active {
    display: block;
}

/* Login screen needs flex display when active */
#loginScreen.active {
    display: flex;
}

/* Login Screen Styles */
#loginScreen {
    background: linear-gradient(135deg, #0072ac 0%, #00c6d7 100%);
    align-items: center;
    justify-content: center;
    margin: 0;
    padding-top: 0;
}

.login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 48px;
    max-width: 420px;
    width: 100%;
    margin: 20px;
}

.bank-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.bank-logo h1 {
    color: #0072ac;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tagline {
    color: #666;
    font-size: 16px;
}

.login-form h2 {
    color: #333;
    margin-bottom: 24px;
    text-align: center;
}

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

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #00c6d7;
    box-shadow: 0 0 0 3px rgba(0, 198, 215, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #0072ac 0%, #00c6d7 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 114, 172, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #0072ac;
    border: 2px solid #0072ac;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #0072ac;
    color: white;
}

.demo-note {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 16px;
    font-style: italic;
}

/* Account Screen Styles */
.app-header {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo h1 {
    color: #0072ac;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-header h1 {
    color: #0072ac;
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info span {
    font-weight: 500;
    color: #333;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 140px 24px 24px; /* Account for fixed header */
}

.dashboard {
    display: grid;
    gap: 32px;
}

/* Accounts Section */
.accounts-section h2,
.payment-section h2 {
    color: #333;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 600;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.account-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #0072ac;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.account-header h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.account-number {
    color: #666;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.account-balance {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balance-label {
    color: #666;
    font-size: 14px;
}

.balance-amount {
    color: #0072ac;
    font-size: 28px;
    font-weight: 700;
}

/* Payment Section */
.payment-form-container {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.nz-payment-fields {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* Section Headers */
.section-header {
    font-size: 18px;
    font-weight: 600;
    color: #002F6B;
    margin-bottom: 8px;
}

.input-group .section-header {
    margin-bottom: 6px;
}

/* Payment Details Sections */
.payment-details-section {
    margin: 24px 0;
    padding: 20px 0;
    border-top: 1px solid #e1e5e9;
}

.payment-details-section:first-child {
    border-top: none;
    padding-top: 0;
}

.section-header-with-copy {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.copy-details-btn {
    background: none;
    border: none;
    color: #0072ac;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.copy-details-btn:hover {
    background-color: #f0f8ff;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e1e5e9;
}

.form-actions .btn-secondary {
    background: transparent;
    border: 1px solid #ccc;
    color: #666;
    padding: 12px 24px;
}

.form-actions .btn-primary {
    width: auto;
    padding: 12px 32px;
}

/* Clickable Account Cards */
.account-card.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.account-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.account-actions {
    margin-top: 12px;
    text-align: right;
}

.view-details {
    color: #0072ac;
    font-size: 14px;
    font-weight: 500;
}

/* Back Button */
.back-btn {
    background: none;
    border: none;
    color: #0072ac;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.back-btn:hover {
    text-decoration: underline;
}

/* Account Detail Screen */
.account-detail-container {
    max-width: 800px;
}

.account-summary-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #0072ac;
    margin-bottom: 32px;
}

.account-summary-card .account-actions {
    text-align: left;
    margin-top: 16px;
}

.account-summary-card .btn-primary {
    width: auto;
    padding: 12px 24px;
}

/* Transactions Section */
.transactions-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.transactions-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-description {
    font-weight: 500;
    color: #333;
}

.transaction-details {
    font-size: 14px;
    color: #666;
}

.transaction-amount {
    font-weight: 600;
    font-size: 16px;
}

.transaction-amount.debit {
    color: #d32f2f;
}

.transaction-amount.credit {
    color: #2e7d32;
}

/* Payment Container */
.payment-container {
    max-width: 600px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    color: #333;
    margin-bottom: 16px;
    font-size: 20px;
}

#paymentDetails {
    margin: 20px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #00c6d7;
}

#paymentDetails p {
    margin: 4px 0;
    color: #333;
}

#paymentDetails .amount {
    font-weight: 700;
    color: #0072ac;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 32px 24px;
        margin: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nz-payment-fields {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .section-header-with-copy {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }

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

    .header-content {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .header-left {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .header-logo {
        gap: 8px;
    }

    .header-logo h1 {
        font-size: 18px;
    }

    .main-content {
        padding: 160px 16px 24px;
    }

    .payment-form-container {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .user-info {
        flex-direction: column;
        gap: 8px;
    }

    .demo-warning {
        font-size: 14px;
        padding: 8px;
    }
}