/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    padding-top: 60px; /* Account for fixed header */
    letter-spacing: -0.03em; /* Global letter spacing */
}

/* Modern Modal/Popup Styling */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    top: 5rem;
    margin: 0 auto;
    padding: 1.25rem;
    width: 24rem;
    max-width: calc(100vw - 2rem);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 640px) {
    .container {
        padding: 0 40px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 80px;
    }
}


/* Unified button container for consistent positioning across all pages */
.back-button-container {
    position: relative;
    margin-bottom: 1.5rem;
    min-height: 32px; /* Ensures consistent spacing even with single button */
}

/* Unified button styling - matching dashboard/clients page exactly */
.back-button, .help-button {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px; /* px-3 py-1.5 in Tailwind = 12px 6px */
    font-size: 13px; /* Slightly larger than text-xs (12px) for better readability */
    font-weight: 500;
    color: #4B5563; /* text-gray-600 */
    background-color: white;
    border: 1px solid #D1D5DB; /* border-gray-300 */
    border-radius: 6px; /* rounded-md */
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: -0.01em;
}

.back-button {
    position: absolute;
    left: 0;
    top: 0;
}

.help-button, .help-button-top {
    position: absolute;
    right: 0;
    top: 0;
}

.back-button:hover, .help-button:hover {
    background-color: #F9FAFB; /* hover:bg-gray-50 */
    border-color: #D1D5DB; /* Keep same border on hover */
    text-decoration: none;
}

.back-button svg, .help-button svg {
    width: 16px; /* w-4 */
    height: 16px; /* h-4 */
    margin-right: 4px; /* mr-1 */
}

/* Header */
.navbar {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    color: #1a1a1a;
    padding: 0.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(210, 210, 215, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.logo-link {
    text-decoration: none;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #0077ED;
    text-decoration: none;
}

.user-email {
    color: #666;
    font-size: 0.95rem;
    font-weight: 400;
}

/* Main Content */
main {
    min-height: calc(100vh - 160px);
    padding: 1rem 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #00703c;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background-color: #005a30;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: transparent;
    color: #0077ED;
    border: 2px solid #0077ED;
}

.btn-secondary:hover {
    background-color: #0077ED;
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.875rem;
}

/* Landing Page */
.landing-page {
    background-color: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
}

.landing-page h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #0077ED;
}

.tagline {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 3rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature {
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.feature h3 {
    color: #0077ED;
    margin-bottom: 0.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-box {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #0077ED;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
}

.account-type-display {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-weight: 500;
}

/* Breadcrumb Navigation */
.header-breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    margin-left: 24px;
}

.header-breadcrumb .breadcrumb {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    font-size: 15px;
}

.header-breadcrumb .breadcrumb-item {
    display: flex;
    align-items: center;
}

.header-breadcrumb .breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin: 0 0.75rem;
    color: #9ca3af;
    font-weight: 300;
}

.header-breadcrumb .breadcrumb-item a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 400;
}

.header-breadcrumb .breadcrumb-item a:hover {
    text-decoration: underline;
}

.header-breadcrumb .breadcrumb-item .current {
    color: #1f2937;
    font-weight: 400;
}


/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.alert-info {
    background-color: #E8F2FF;
    color: #0077ED;
    border: 2px solid #C9E2FF;
}

/* Dashboard */
.dashboard-header {
    text-align: left;
    margin-bottom: 20px;
    margin-left: 60px;
}

.dashboard-header h1 {
    color: #0b0c0c;
    font-size: 48px;
    font-weight: 400;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.dashboard-subtitle {
    color: #505a5f;
    font-size: 24px;
    font-weight: 400;
}

.user-info {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.tax-years-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.tax-years-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.tax-year-left-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.tax-year-right-column {
    display: flex;
    flex-direction: column;
}

.past-years-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    align-content: start;
}

.tax-year-card {
    border: none;
    border-radius: 8px;
    background: #E3EDF3;
    transition: all 0.2s ease;
    overflow: hidden;
    width: 240px;
    height: 298px;
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.tax-year-card-current {
    width: 240px;
    height: 298px;
    padding: 0;
    background: #E8F5E9;
    position: relative;
}

.tax-year-card-past {
    width: 240px;
    height: 298px;
    padding: 1.6rem;
}

.tax-year-card:hover {
    transform: translateY(-1px);
}

.tax-year-card-current:hover {
    background: #D4EED5;
}

.tax-year-card-past:hover {
    background: #D5E3EB;
}

.tax-year-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #1a1a1a;
    width: 100%;
    height: 100%;
    position: relative;
    text-align: left;
}

.tax-year-top {
    flex: 0 0 auto;
}

.tax-year-middle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    padding: 0 1rem;
}

.tax-year-bottom {
    margin-top: auto;
}

.tax-year-dates {
    font-size: 14px;
    color: #666;
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}

.tax-year-status {
    font-size: 18px;
    color: #1a1a1a;
    font-weight: 500;
    margin: 0;
    letter-spacing: -0.01em;
}

.tax-year-card-past .tax-year-dates {
    font-size: 12px;
}

.tax-year-card-past .tax-year-status {
    font-size: 16px;
}

.tax-year-link:hover {
    text-decoration: none;
    color: #1a1a1a;
}

/* Current year tile specific styles */
.tax-year-link-current {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    color: #1a1a1a;
    width: 100%;
    height: 100%;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.tax-year-link-current .tax-year-top {
    padding: 2rem 1.5rem 0;
}

.tax-year-link-current .tax-year-bottom {
    padding: 0 1.5rem 1.5rem;
}

.tax-year-number-current {
    font-size: 42px;
    font-weight: 400;
    color: #1a1a1a;
    line-height: 1;
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
}

.tax-year-dates-current {
    font-size: 14px;
    color: #666;
    margin: auto 0;
    text-align: center;
    letter-spacing: -0.01em;
}

.tax-year-status-current {
    font-size: 18px;
    color: #1a1a1a;
    font-weight: 500;
    margin: auto 0 0 0;
    letter-spacing: -0.01em;
}

.tax-year-number {
    font-size: 42px;
    font-weight: 400;
    color: #1a1a1a;
    line-height: 1;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.tax-year-card-past .tax-year-number {
    font-size: 36px;
}



.tax-year-actions {
    margin-top: 1.5rem;
}

.create-tax-year {
    border-top: 1px solid #ddd;
    padding-top: 2rem;
}

.no-business-message {
    color: #505a5f;
    font-style: italic;
}

.no-business-message a {
    color: #0077ED;
    text-decoration: underline;
}

/* Journey Progress */
.journey-progress {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.journey-progress .step {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
}

.journey-progress .step.completed {
    background-color: #d4edda;
    color: #155724;
}

.journey-progress .step.active {
    background-color: #DAE9FF;
    color: #0077ED;
    font-weight: bold;
}

/* Obligations Table */
.business-obligations {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.business-info {
    color: #666;
    margin-bottom: 1rem;
}

.obligations-table {
    width: 100%;
    border-collapse: collapse;
}

.obligations-table th,
.obligations-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #D2D2D7;
}

.obligations-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-open {
    background-color: #fff3cd;
    color: #856404;
}

.status-fulfilled {
    background-color: #d4edda;
    color: #155724;
}

.completed {
    color: #28a745;
    font-weight: 500;
}

/* Actions */
.actions {
    margin-top: 2rem;
    text-align: center;
}

/* Error Page */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.error-page h1 {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-page pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: left;
    overflow-x: auto;
}

/* OAuth Section */
.oauth-section {
    margin-top: 2rem;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #666;
}

.divider:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 0;
}

.divider:after {
    content: 'OR';
    background: white;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.btn-hmrc {
    background-color: #008938;
    color: white;
    text-align: center;
    margin-bottom: 0.5rem;
}

.btn-hmrc:hover {
    background-color: #006829;
    color: white;
}

.oauth-note {
    text-align: center;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Journey Progress Tracker */
.journey-progress {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 2px solid #ddd;
}

.journey-progress .step {
    padding: 0.5rem 0;
    color: #666;
    border-left: 3px solid #ddd;
    padding-left: 1rem;
    margin-left: 0.5rem;
}

.journey-progress .step.completed {
    color: #28a745;
    border-left-color: #28a745;
    font-weight: 500;
}

.journey-progress .step.active {
    color: #0077ED;
    border-left-color: #0077ED;
    font-weight: 600;
    background-color: #F0F7FF;
    margin-left: 0;
    padding-left: 1.5rem;
}

/* Submission Form */
.submission-info {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.submission-info h2 {
    margin-top: 0;
    color: #0077ED;
}

.submission-info p {
    margin: 0.5rem 0;
}

.submission-form fieldset {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.submission-form legend {
    font-weight: 600;
    color: #0077ED;
    padding: 0 0.5rem;
}

.info-box {
    background-color: #E8F2FF;
    border: 2px solid #C9E2FF;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.help-text {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
    font-weight: normal;
}

.form-summary {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: right;
}

/* Success Message */
.success-message {
    background-color: #d4edda;
    border: 2px solid #c3e6cb;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.success-message h2 {
    color: #155724;
    margin: 0 0 0.5rem 0;
}

/* Submission Details */
.submission-details {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 2px solid #ddd;
}

.details-table {
    width: 100%;
    margin-top: 1rem;
}

.details-table th {
    text-align: left;
    padding: 0.5rem;
    width: 40%;
}

.details-table td {
    padding: 0.5rem;
}

/* Next Steps */
.next-steps {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.next-steps ul {
    margin: 1rem 0 0 1.5rem;
}

.next-steps li {
    margin: 0.5rem 0;
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 2px solid #888;
    width: 400px;
    max-width: 80%;
    border-radius: 8px;
}

.modal-content h3 {
    margin-top: 0;
}

.modal-content form {
    margin-top: 20px;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content button {
    margin-right: 10px;
}