:root {
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 16px;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
*, *::before, *::after {
	box-sizing: inherit;
}
body {
	padding: 1rem;
	margin: 0;
	min-height: 100vh;
	background-color: #fafafa;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}
#app {
	max-width: 100%;
	margin: 0 auto;
}
.content-section {
	animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
img[alt="logo ppa"] {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto 1rem;
}
h2 {
	font-size: 1.5rem;
	margin: 0.5rem 0;
	color: #333;
}
h3 {
	font-size: 1.2rem;
	margin: 1rem 0 0.5rem;
	color: #333;
}
p {
	font-size: 0.9rem;
	line-height: 1.5;
	color: #666;
	margin: 0.5rem 0;
}
li {
	list-style-type: none;
	border-bottom: 1px solid #e0e0e0;
	margin: 0;
	padding: 0;
}
li > a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	text-decoration: none;
	color: #333;
	padding: 1rem;
	min-height: 48px;
	transition: background-color 0.15s;
}
li > a:active {
	background-color: #f0f0f0;
}
.caret-right {
	transform: rotate(-90deg);
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}
.go-back {
	text-decoration: none;
	color: #f47216;
	display: flex;
	align-items: center;
	padding: 0.75rem 0;
	margin-bottom: 1rem;
	font-weight: 500;
	min-height: 44px;
}
label {
	color: #666;
	font-size: 0.9rem;
	margin-bottom: 0.5rem;
	display: block;
}
.text-container {
	display: flex;
	flex-direction: column;
	margin-bottom: 0.1rem;
}.dropdown-input-wrapper {
	position: relative;
	display: block;
}
.dropdown-input-wrapper::after {
	content: '';
	position: absolute;
	right: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #666;
	pointer-events: none;
}
.password-input-wrapper {
	position: relative;
	display: block;
}
.password-input-wrapper input {
	padding-right: 3rem;
}
.toggle-password {
	position: absolute;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 0.5rem;
	cursor: pointer;
	color: #666;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
}
.toggle-password:hover {
	color: #f47216;
}
.toggle-password:focus {
	outline: 2px solid #f47216;
	outline-offset: 2px;
	border-radius: 0.25rem;
}input[type="password"],
input[type="text"],
input[type="number"],
input[type="time"],
select {
	padding: 0.75rem;
	border: 1px solid #ddd;
	border-radius: 0.5rem;
	background-color: #fff;
	width: 100%;
	font-size: 16px;
	transition: border-color 0.2s;
	-webkit-appearance: none;
	appearance: none;
}
input[type="password"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="time"]:focus,
select:focus {
	outline: none;
	border-color: #f47216;
	box-shadow: 0 0 0 3px rgba(244, 114, 22, 0.1);
}
input[type="checkbox"] {
	width: 24px;
	height: 24px;
	cursor: pointer;
}
input:disabled,
select:disabled {
	background-color: #f5f5f5;
	color: #999;
	cursor: not-allowed;
	opacity: 0.6;
}
input[type="submit"] {
	padding: 0.875rem 1.5rem;
	width: 100%;
	max-width: 100%;
	border: 0;
	border-radius: 0.5rem;
	background-color: #f47216;
	color: white;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	margin-top: 1rem;
	min-height: 48px;
	transition: background-color 0.2s;
}
input[type="submit"]:active {
	background-color: #d55f0e;
}
button,
.button-container {
	padding: 0.75rem 1rem;
	border: 0;
	border-radius: 0.5rem;
	background-color: #f47216;
	color: white;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	min-height: 44px;
	transition: background-color 0.2s;
	text-align: center;
	text-decoration: none;
	display: inline-block;
}
button:active,
.button-container:active {
	background-color: #d55f0e;
}
form {
	display: flex;
	flex-direction: column;
}
.error {
	font-size: 0.8rem;
	color: #dc2626;
	margin-top: 0.25rem;
	min-height: 1rem;
}
.error-outline {
	border-color: #dc2626 !important;
}
.success {
	color: white;
	background-color: #22c55e;
	padding: 1rem;
	border-radius: 0.5rem;
	margin: 1rem 0;
}
.success > h2 {
	margin: 0;
	font-size: 1.2rem;
}
.container {
	display: flex;
	flex-direction: column;
}
.title {
	font-size: 0.85rem;
	font-weight: 400;
	color: #666;
}
.token {
	font-size: 1.5rem;
	letter-spacing: 0.3rem;
	margin: 0.5rem 0;
	word-break: break-all;
	font-family: monospace;
}
.row {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}
.automation-config {
	background-color: #fff;
	border-radius: 0.5rem;
	padding: 1rem;
	margin-bottom: 1rem;
	border-left: 4px solid #f47216;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.automation-status {
	background-color: #fff;
	border-radius: 0.5rem;
	padding: 1rem;
	margin: 1rem 0;
	border: 1px solid #e0e0e0;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.automation-status .row {
	justify-content: space-between;
	margin-bottom: 0.75rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid #f0f0f0;
	flex-wrap: nowrap;
}
.automation-status .row:last-child {
	border-bottom: none;
	margin-bottom: 0;
}
.automation-status .row .title {
	flex-shrink: 0;
	margin-right: 1rem;
}
.automation-status .row > span:last-child {
	text-align: right;
	word-break: break-word;
}
.copy-button {
	background-color: #f47216;
	color: #fff;
	border: none;
	border-radius: 0.3rem;
	padding: 0.4rem 0.8rem;
	font-size: 0.8rem;
	cursor: pointer;
	margin-left: 0.5rem;
	transition: background-color 0.2s;
}
.copy-button:active {
	background-color: #d55f0e;
}
.copy-button.copied {
	background-color: #22c55e;
}
.row-with-copy {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.row-with-copy > div {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 1;
	min-width: 0;
}
.row-with-copy span:not(.title) {
	word-break: break-all;
}

/* Melhorias para touch devices */
@media (hover: none) and (pointer: coarse) {
	input[type="submit"],
	button,
	.button-container,
	li > a {
		min-height: 48px;
	}
}

/* Ajustes para telas pequenas */
@media (max-width: 480px) {
	body {
		padding: 0.75rem;
	}
	h2 {
		font-size: 1.3rem;
	}
	h3 {
		font-size: 1.1rem;
	}
	.token {
		font-size: 1.2rem;
		letter-spacing: 0.2rem;
	}
	.row {
		gap: 0.5rem;
	}
	input[type="submit"] {
		width: 100%;
	}
}

/* Prevenir zoom em inputs no iOS */
@media screen and (max-width: 767px) {
	input[type="text"],
	input[type="password"],
	input[type="number"],
	input[type="time"],
	select {
		font-size: 16px;
	}
}

/* Tutorial Screen */
#tutorial-screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 80vh;
	text-align: center;
	padding: 2rem 1rem;
}

#tutorial-screen h2 {
	color: #333;
	margin-bottom: 1.5rem;
}

.tutorial-content {
	background-color: white;
	border-radius: 1rem;
	padding: 1.5rem;
	margin: 1.5rem auto;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	max-width: 400px;
	width: 100%;
}

.tutorial-step {
	font-size: 1rem;
	line-height: 1.8;
	color: #333;
	text-align: left;
	margin: 1rem 0;
	padding: 0.75rem;
	background-color: #f9fafb;
	border-radius: 0.5rem;
	border-left: 4px solid #f47216;
}

.tutorial-step strong {
	color: #f47216;
}

.primary-button {
	background-color: #f47216;
	color: white;
	font-size: 1.1rem;
	font-weight: 600;
	padding: 1rem 2rem;
	border: none;
	border-radius: 0.75rem;
	cursor: pointer;
	transition: background-color 0.2s, transform 0.1s;
	min-height: 56px;
	box-shadow: 0 4px 12px rgba(244, 114, 22, 0.3);
}

.primary-button:hover {
	background-color: #d55f0e;
}

.primary-button:active {
	background-color: #d55f0e;
	transform: scale(0.98);
}

/* Loading Screen */
#loading-screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 80vh;
	text-align: center;
}

#loading-screen h2 {
	color: #333;
	margin-left: auto;
	margin-right: auto;
}

#loading-screen p {
	color: #666;
	max-width: 320px;
	font-size: 0.95rem;
	margin-left: auto;
	margin-right: auto;
}

/* Loader Animation */
.loader {
	width: 60px;
	height: 60px;
	border: 5px solid #f0f0f0;
	border-top: 5px solid #f47216;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto;
}

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

/* Error Screen */
#error-screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 80vh;
	text-align: center;
	padding: 2rem 1rem;
}

.error-icon {
	font-size: 4rem;
	margin-bottom: 1rem;
}

.error-title {
	color: #dc2626;
	margin-bottom: 1rem;
}

.error-text {
	color: #666;
	max-width: 320px;
	margin: 1rem auto 2rem;
	line-height: 1.6;
	text-align: center;
}

.retry-button {
	background-color: #f47216;
	color: white;
	font-size: 1rem;
	font-weight: 600;
	padding: 0.875rem 1.5rem;
	border: none;
	border-radius: 0.5rem;
	cursor: pointer;
	margin: 0.5rem;
	min-height: 48px;
	transition: background-color 0.2s;
}

.retry-button:active {
	background-color: #d55f0e;
}

.secondary-button {
	background-color: #6b7280;
	color: white;
	font-size: 0.9rem;
	font-weight: 500;
	padding: 0.75rem 1.25rem;
	border: none;
	border-radius: 0.5rem;
	cursor: pointer;
	margin: 0.5rem;
	min-height: 44px;
	transition: background-color 0.2s;
}

.secondary-button:active {
	background-color: #4b5563;
}

/* Relay Control Cards */
.relay-card {
	background-color: white;
	border-radius: 0.75rem;
	padding: 1.5rem;
	margin-bottom: 1rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.relay-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #e5e7eb;
}

.relay-header h3 {
	margin: 0;
	font-size: 1.25rem;
	color: #333;
}

.relay-status {
	font-size: 0.9rem;
	padding: 0.25rem 0.75rem;
	border-radius: 0.375rem;
	background-color: rgba(0, 0, 0, 0.05);
}

.toggle-relay-btn {
	width: 100%;
	padding: 0.875rem;
	border: none;
	border-radius: 0.5rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	background-color: #f47216;
	color: white;
	margin-bottom: 0.5rem;
}

.toggle-relay-btn:hover {
	background-color: #d66214;
}

.toggle-relay-btn:active {
	transform: scale(0.98);
}

.config-relay-btn {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 0.5rem;
	font-size: 0.95rem;
	cursor: pointer;
	background-color: white;
	color: #666;
	transition: all 0.2s;
}

.config-relay-btn:hover {
	background-color: #f9fafb;
	border-color: #f47216;
	color: #f47216;
}

.relay-config {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #e5e7eb;
}

.relay-config h4 {
	margin: 0 0 1rem 0;
	font-size: 1.1rem;
	color: #333;
}

.relay-config small {
	display: block;
	color: #666;
	font-size: 0.85rem;
	margin-top: 0.25rem;
}

.save-relay-config {
	width: 100%;
	padding: 0.875rem;
	border: none;
	border-radius: 0.5rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	background-color: #22c55e;
	color: white;
	margin-top: 1rem;
	transition: all 0.2s;
}

.save-relay-config:hover {
	background-color: #16a34a;
}

.save-relay-config:active {
	transform: scale(0.98);
}
