/* TO BE RESTRUCTURED */
.topbar-logo-container svg {margin-right:10px;}

.grecaptcha-badge {
	bottom: 60px !important;
}

@media (max-width: 900px) {
	.grecaptcha-badge {
		bottom: 90px !important;
	}
}

@media (max-width: 720px) {
	.grecaptcha-badge {
		bottom: 120px !important;
	}
}

/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    /* Brand Colors */
    --nzags-blue: #0090c0;
    --nzags-dark: #003366;
    --nzags-orange: #f7921e;
    
    /* UI Colors */
    --light-bg: #f4f7f6;
    --white: #ffffff;
    --border-color: #dddddd;
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* Semantic Status Colors */
    --success-bg: #d4edda;
    --success-text: #155724;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --warning-bg: #fff3cd;
    --warning-text: #856404;
    --info-bg: #e3f2fd;
    --info-text: #003366;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background-color: var(--bg-colour);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1,h2 {color:var(--text-heading-colour)}
h3,h4 {color:var(--text-subheading-colour)}

.center {text-align:center;}
.left {text-align:left;}
.right {text-align:right;}
.mb-10 {margin-bottom:10px;}
.mb-30 {margin-bottom:30px;}
.mt-10 {margin-top:10px;}
.mt-30 {margin-top:30px;}



/* ==========================================================================
   2. LAYOUT STRUCTURE
   ========================================================================== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

header, footer {
    flex-shrink: 0;
}

*::-webkit-scrollbar {
width: 8px;
}

*::-webkit-scrollbar-track {
background: #ffffff;
}

*::-webkit-scrollbar-thumb {
background-color: var(--primary-colour);
border-radius: 8px;
}

.content-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    width: 100%;
}

@media (max-width: 600px) {
	.content-wrapper {
		padding: 10px 0px;
	}
}

.content-wrapper.p-top {
	justify-content:unset;
} 

.content-wrapper.s-full {
	padding:0;
} 

.content-wrapper.s-full main {
	max-width:unset;
	border-radius: 0px;
	padding:20px;
	height:100%;
} 

.container {
    background: var(--bg-colour);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 1200px;
    flex: 0 1 auto;
}

.container.welcome, .container.login {
    max-width: 500px;
	text-align: center;
}
.container.welcome .btn-large {text-decoration: none; display: inline-block;}
.container.register {
    max-width: 800px;
    padding: 10px;
}
.container .disclaimer {margin-top: 50px; padding: 20px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.85em; color: #475569; line-height: 1.6;}
.container .disclaimer-inner {display:flex; align-items:center; gap:8px; margin-bottom:8px;}
.container .disclaimer-icon {font-size:1.2em;}
.container .disclaimer-title {text-transform:uppercase; letter-spacing:0.5px; color: #003366;}
.login .alert {margin-bottom: 15px;}
.login p {text-align: center; margin-top: 20px; font-size: 0.85em;}
.login p a {color: var(--button-primary-bg); text-decoration: none; font-weight: bold;}
.login label {font-size: 0.85em; font-weight: bold; color: #64748b; display: block; margin-bottom: 5px;}
.login input {width:100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px;}
.login #mfaSection {display:none; margin-top:15px; border-top:1px solid #eee; padding-top:15px;}
.login #mfaSection label {display:block; text-align:center; font-size: 0.85em; font-weight: bold; color: #003366; margin-bottom: 10px;}
.login #mfaSection input {text-align: center; width:100%; letter-spacing: 5px; font-size:1.4em; padding: 8px; border: 2px solid #003366; border-radius: 6px; color: #003366;}
.login #login-submit {width:100%; margin-top:25px; padding: 12px; font-size: 1em;}

.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.bg::before {
    content: '';
    position: absolute;
    inset: -30px;
    background: url('/assets/blue.png') right bottom / auto 100% no-repeat;
	background-size: cover;
    filter: blur(10px);
}

.bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 51, 102, 0.45);
}

footer {
    flex-shrink: 0;
    width: 100%;
}

/* ==========================================================================
   3.a NAVIGATION (TOPBAR)
   ========================================================================== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-colour);
    padding: 5px 20px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
    color: var(--primary-text);
    border-bottom: 1px solid white;
    box-shadow: 0 0 20px 0 rgba(0, 51, 102, 0.45);
}

.topbar-left { display: flex; align-items: center; gap: 20px; }
.topbar-home { height: 42px; border: 1px solid rgba(255,255,255,0.3); padding: 4px; border-radius: 6px; margin:2px 10px; }
.topbar-logo { height: 50px; width: auto; }
.topbar-logo-container { text-decoration: none; }

.topbar-center { flex-grow: 1; text-align: center; }
.topbar-title { font-weight: bold; font-size: 1.1em; color: var(--primary-text); }

.topbar-right { display: flex; align-items: center; gap: 15px; }

.logout-btn, .login-btn { 
    background: rgba(255,255,255,0.1); 
    color: var(--primary-text); 
    padding: 6px 15px; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 0.85em; 
    font-weight: bold; 
}

.register-btn { 
    background: var(--secondary-colour); 
    color: var(--secondary-text); 
    padding: 6px 15px; 
    border-radius: 4px; 
    text-decoration: none; 
    font-size: 0.85em; 
    font-weight: bold; 
}

.submenu-title {
	background: #F8F8F8;
	padding: 2px 20px;
	font-size: 0.7em;
	color: var(--nzags-blue);
	font-weight: bold;
	text-transform: uppercase;
	border-top: 1px solid #C4C4C4;
}
.mobilemenu-title {
	background: rgba(0,0,0,0.2); 
	padding: 10px 20px; 
	font-size: 0.7em; 
	color: #8af; 
	font-weight: bold; 
	text-transform: uppercase;
}

/* ==========================================================================
   3.b NAVIGATION (FOOTER)
   ========================================================================== */
   .app-footer {
		background: var(--primary-colour);
		color: var(--primary-text); 
		padding: 15px 20px;
		font-size: 0.85em;
		border-top: 1px solid rgba(255,255,255,0.1);
	}

	.footer-inner {
		max-width: 1200px;
		margin: 0 auto;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 10px;
	}

	.footer-left,
	.footer-center,
	.footer-right {
		flex: 1;
		white-space: nowrap;
	}

	.footer-left   { text-align: left; }
	.footer-center { text-align: center; }
	.footer-right  { text-align: right; }

	.footer-right a {
		color: var(--secondary-colour);
		font-weight: bold;
		text-decoration: none;
	}
	
	@media (max-width: 900px) {
		.footer-left,
		.footer-right {
			flex: 0 0 49%;
		}

		.footer-center {
			flex: 0 0 100%;
			order: 3;
			text-align: center;
		}
	}
	
	@media (max-width: 675px) {
		.footer-inner div {text-align: center;}
		.footer-left,
		.footer-center,
		.footer-right {
			flex: 0 0 100%;
			white-space: normal;
		}

		.footer-center { order: 3; }
		.footer-left   { order: 1; }
		.footer-right  { order: 2; }
	}

/* ==========================================================================
   4. COMPONENTS (BUTTONS, PILLS, ALERTS)
   ========================================================================== */

.btn {
	padding: 5px 15px; 
	text-decoration:none; 
	border:1px solid #ddd; 
	border-radius:20px; 
	color:#666; 
	font-size:0.8em;
}

.btn-medium {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

button.primary, .btn-primary { background: var(--button-primary-bg); color: var(--button-primary-colour) !important; }
button.secondary, .btn-secondary { background: var(--button-secondary-bg); color: var(--button-secondary-colour) !important; }
button.danger, .btn-danger { background: var(--error-bg); color: var(--error-text) !important; }
button.danger, .btn-warning { background: var(--warning-bg); color: var(--warning-text) !important; }
button.danger, .btn-info { background: var(--info-bg); color: var(--info-text) !important; }

button:hover
{ opacity:0.8;}


.btn-large {
	padding: 15px 40px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1em;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.2);
    transition: 0.3s ease;
}
.btn-large:hover { transform: translateY(-2px); opacity: 0.95 !important; }

.btn:disabled {
    opacity: 0.25 !important;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}
.alert-error { background: var(--error-bg); color: var(--error-text); border: 1px solid #f5c6cb; }
.alert-info  { background: var(--info-bg); color: var(--info-text); border: 1px solid #bee5eb; }

/* ==========================================================================
   5. FORMS & INPUTS
   ========================================================================== */
.form-group { margin-bottom: 20px; text-align: left; }

.form-section {
    background: #FFFFFF69;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.form-section h3 {
    margin-top: 0;
    border-bottom: 2px solid #003366;
    padding-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.form-row input {
    flex: 1;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }

    .form-row input {
        width: 100%;
    }
}

label { font-size: 0.85em; font-weight: bold; color: var(--text-muted); display: block; margin-bottom: 5px; }

input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="date"], 
input[type="number"],
input[type="tel"],
select, 
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
	background:#FFFFFF69;
}

input:focus, textarea:focus {
    border-color: var(--nzags-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 144, 192, 0.1);
}

.flex-row { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 15px; }
.flex-item { flex: 1; min-width: 240px; }

/* ==========================================================================
   6. TABLES
   ========================================================================== */
table:not(.component-table) { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
table:not(.component-table) th { background: #f8fafc; padding: 12px; text-align: left; border-bottom: 2px solid var(--nzags-dark); font-size: 0.85em; color: var(--text-muted); text-transform: uppercase; }
table:not(.component-table) td { padding: 12px; border-bottom: 1px solid #eee; }

/* ==========================================================================
   7. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .container { width: 95%; margin: 10px auto; padding: 20px; }
    .topbar-title { font-size: 0.9em; }
    .topbar-logo { height: 35px; }
    .topbar-home { height: 35px; }
	.content-wrapper.s-full { padding:0; } 
	.content-wrapper.s-full main.container { width: 100%; margin:unset;}
}

/* ==========================================================================
   8. MISC / UTILITIES
   ========================================================================== */
.welcome .tagline { color: var(--text-muted); font-size: 1.1em; margin-bottom: 30px; }

.login-link { 
	margin-top: 20px; 
	display: block; 
	color: var(--nzags-blue); 
	text-decoration: none; 
	font-weight: 700; 
	color: #003366;
	}

.welcome .disclaimer {
    font-size: 0.8em;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ==========================================================================
   9. ROLE BADGES
   ========================================================================== */

/* Role Badges */
.role-badge { 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 0.75em; 
    text-transform: uppercase; 
    font-weight: 800; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.role-admin     { background: #fee2e2; color: #991b1b; }
.role-staff     { background: #e0f2fe; color: #0369a1; }
.role-reviewer  { background: #fef3c7; color: #92400e; }
.role-referee   { background: #ffddff; color: #600060; }
.role-applicant { background: #f1f5f9; color: #475569; }