/* ===== Color Palette ===== */
:root {
    --primary-blue: #0a2f75;
    --accent-gold: #fed301;
    --light-grey: #f0f4f7;
    --white: #ffffff;
    --black: #000000;
    --grey: #808080;
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #1a4a9c 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ===== Smartphone Container ===== */
.smartphone-container {
    width: 100%;
    max-width: 420px;
    height: 100vh;
    max-height: 900px;
    background: var(--white);
    border-radius: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.phone-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
}

/* Make header stick to top of the phone-content when scrolling */
.phone-header {
    position: sticky;
    top: 0;
    z-index: 50;
}

.phone-content::-webkit-scrollbar {
    width: 4px;
}

.phone-content::-webkit-scrollbar-track {
    background: var(--light-grey);
}

.phone-content::-webkit-scrollbar-thumb {
    background: var(--grey);
    border-radius: 2px;
}

/* ===== Header Styling ===== */
.phone-header {
    background: var(--accent-gold);
    color: var(--white);
    padding: 14px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.phone-header h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--white);
}

.logo {
    width: 56px;
    height: auto;
    display: block;
    margin-right: 12px;
}

.admin-logo {
    width: 72px;
    height: auto;
    display: inline-block;
    margin-right: 12px;
}

/* ===== Form Styling ===== */
.form-container {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--black);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--light-grey);
    color: var(--black);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(254, 211, 1, 0.1);
}

/* ===== Button Styling ===== */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--black);
}

.btn-primary:hover {
    background: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 211, 1, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--primary-blue);
    color: var(--white);
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #082052;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 47, 117, 0.3);
}

.btn-block {
    width: 100%;
    margin-bottom: 12px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

/* ===== Choice Buttons (New/Existing) ===== */
.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 30px;
}

.choice-btn {
    padding: 20px;
    border: 2px solid var(--light-grey);
    border-radius: 12px;
    background: var(--light-grey);
    color: var(--black);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-btn:hover {
    border-color: var(--accent-gold);
    background: var(--white);
    box-shadow: 0 4px 12px rgba(254, 211, 1, 0.2);
}

.choice-btn:active {
    transform: scale(0.98);
}

/* ===== Bottom Navigation Bar ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    height: 70px;
    background: var(--white);
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-radius: 0 0 40px 40px;
}

.bottom-nav.hidden {
    display: none;
}

.nav-item {
    flex: 1;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-item.active {
    color: var(--primary-blue);
}

.nav-item.inactive {
    color: var(--grey);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

/* Ensure nav icons explicitly inherit and follow active/inactive colors
   (useful when icons are text or icon-fonts). Note: platform-colored
   emojis (native emoji fonts on Windows/macOS) may not change color; for
   those consider replacing with SVG or an icon font for full color control.) */
.nav-item .nav-icon {
    color: inherit;
}

.nav-item.active .nav-icon {
    color: var(--primary-blue);
}

.nav-item.inactive .nav-icon {
    color: var(--grey);
}

.nav-label {
    font-size: 12px;
    font-weight: 500;
}

/* ===== T&C Scrollable Area ===== */
	.tc-container {
		padding: 12px; /* tightened container padding */
		flex: 1;
		display: flex;
		flex-direction: column;
	}

	.tc-content {
		flex: 0 0 auto;
		background: var(--light-grey);
		padding: 10px; /* reduced padding */
		border-radius: 8px;
		overflow: visible;
		font-size: 13px;
		line-height: 1.3; /* a bit tighter */
		color: var(--black);
		margin-bottom: 120px;
	}

	.tc-content::-webkit-scrollbar {
		width: 4px;
	}

	.tc-content::-webkit-scrollbar-track {
		background: #e0e0e0;
	}

	.tc-content::-webkit-scrollbar-thumb {
		background: var(--grey);
		border-radius: 2px;
	}

	.tc-content h2 {
		font-size: 16px;
		margin-top: 8px;
		margin-bottom: 8px;
		color: var(--primary-blue);
	}

	/* Terms list styling */
	.tc-list {
		list-style: none;
		padding: 0;
		margin: 0;
		padding-bottom: 60px;
	}

	.tc-list li {
		display: block;
		padding: 6px 0; /* tighter spacing between items */
		border-bottom: 1px dashed #e6e9ee;
	}

	.term-title {
		font-weight: 700;
		color: var(--black);
		font-size: 13px; /* slightly smaller title */
	}

	.term-desc {
		font-size: 12px; /* slightly smaller description */
		color: #444;
		margin-top: 3px; /* tighter spacing under title */
		line-height: 1.15;
	}

	.tc-content h3 {
		font-size: 13px;
		margin-top: 8px;
		margin-bottom: 6px;
		color: var(--black);
	}

	.tc-content p {
		margin-bottom: 8px;
		text-align: justify;
	}

	.tc-content ul {
		margin-left: 18px;
		margin-bottom: 8px;
	}

	.tc-content li {
		margin-bottom: 4px;
	}

	/* Sticky action area so the Accept button is always visible */
	.tc-actions {
		position: sticky;
		bottom: 20px; /* leaves room above bottom nav */
		background: transparent;
		display: flex;
		flex-direction: column;
		gap: 10px;
		padding: 16px 4px 0 4px;
		margin-top: 32px;
		z-index: 60;
	}

	.tc-actions .tc-accept {
		display: flex;
		align-items: center;
		gap: 10px;
		font-size: 13px;
		color: var(--black);
	}

	.tc-actions .btn-block {
		width: 100%;
	}
/* ===== Modal Styling ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.modal-body {
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--black);
    line-height: 1.6;
}

.modal-footer {
    padding: 15px;
    text-align: center;
}

.modal-footer .btn {
    width: 100%;
}

/* ===== Canvas Signature ===== */
.signature-container {
    margin-top: 20px;
    border: 2px dashed var(--grey);
    border-radius: 8px;
    padding: 10px;
    background: var(--light-grey);
}

.signature-label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    font-size: 14px;
}

#signatureCanvas {
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: crosshair;
    background: var(--white);
    display: block;
    width: 100%;
    height: 150px;
    touch-action: none;
}

.signature-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.signature-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 13px;
}

/* ===== File Upload ===== */
.file-upload-group {
    margin: 15px 0;
}

.file-upload-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--black);
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: block;
    padding: 12px;
    background: var(--light-grey);
    border: 2px dashed var(--grey);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    color: var(--grey);
    transition: all 0.3s ease;
}

.file-input-label:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.file-name {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--primary-blue);
    font-weight: 500;
}

/* ===== Error & Success Messages ===== */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    text-align: center;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.alert-info {
    background: #eef;
    color: #33c;
    border: 1px solid #ccf;
}

/* ===== Validation Feedback ===== */
.form-group.has-error input,
.form-group.has-error select {
    border-color: #c33;
}

.error-message {
    color: #c33;
    font-size: 12px;
    margin-top: 5px;
}

/* ===== Centered Content ===== */
.centered-content {
    text-align: center;
    padding: 30px 20px;
}

.centered-content h2 {
    color: var(--primary-blue);
    font-size: 20px;
    margin-bottom: 30px;
}

.centered-content p {
    color: var(--black);
    font-size: 14px;
    margin-bottom: 15px;
}

/* Small section title used in forms */
.section-title {
    font-size: 15px;
    color: var(--primary-blue);
    margin: 0 0 10px 0;
    font-weight: 700;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .smartphone-container {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }

    .bottom-nav {
        border-radius: 0;
    }

    body {
        padding: 0;
    }
}
